// from: https://thief.one/js/src/love.js ! function (e, t, a) { function n() { c( ".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), o(), r() } function r() { for (var e = 0; e < d.length; e++) d[e].alpha <= 0 ? (t.body.removeChild(d[e].el), d.splice(e, 1)) : (d[e].y--, d[e].scale += .004, d[e].alpha -= .013, d[e].el.style.cssText = "left:" + d[e].x + "px;top:" + d[e].y + "px;opacity:" + d[e].alpha + ";transform:scale(" + d[e].scale + "," + d[e].scale + ") rotate(45deg);background:" + d[e].color + ";z-index:99999"); requestAnimationFrame(r) } function o() { var t = "function" == typeof e.onclick && e.onclick; e.onclick = function (e) { t && t(), i(e) } } function i(e) { var a = t.createElement("div"); a.className = "heart", d.push({ el: a, x: e.clientX - 5, y: e.clientY - 5, scale: 1, alpha: 1, color: s() }), t.body.appendChild(a) } function c(e) { var a = t.createElement("style"); a.type = "text/css"; try { a.appendChild(t.createTextNode(e)) } catch (t) { a.styleSheet.cssText = e } t.getElementsByTagName("head")[0].appendChild(a) } function s() { return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")" } var d = []; e.requestAnimationFrame = function () { return e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) { setTimeout(e, 1e3 / 60) } }(), n() }(window, document);

Sublime-Text-技巧

Sublime Text 3下载地址:

https://www.sublimetext.com/3

Ubuntu 18.04 安装命令

snap install sublime-text

安装插件支持-获取安装代码

  1. 搜索引擎(百度、Google等)搜索“sublime text 3 package control install”
  2. 从搜索结果中找到“Installation - Package Control”,即下面的网站:

    https://packagecontrol.io/installation#st3

  3. 复制 “SUBLIM TEXT 3”选项卡下面的代码:
    import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
    
  4. 打开sublime text控制台,有以下几种方式:
    • 点击sublime text左下角的图标,在弹出的菜单中选择“Console”
    • 点击sublime text顶部菜单栏中的“View(V)”,选择“Show/Hide Console”
    • 直接在sublime text中按快捷键“Ctrl + `”
  5. 在打开的控制台输入框中输入第[3]步得到的代码,然后回车等待

打开命令面板

两种方式:

  • 直接在sublime text中按快捷键“Ctrl + Shift + P”
  • 点击sublime text顶部菜单栏中的“Tool(T)”,选择“Command Palette...”

插件安装/卸载/列举等命令

  1. pcip(Package Control: Install Package): 安装插件
  2. pclp(Package Control: List Package): 列举已安装的插件
  3. pcrp(Package Control: Remove Package): 删除插件

常用插件名

  • ChineseLocalizations 汉化
  • SublimeCodeIntel 代码感知
  • ConvertToUTF8 字符编码检测
  • jQuery: jQuery代码提示
  • Jedi - Python autocompletion Python代码提示
  • Jinja2 Jinja2语法提示
  • MarkdownEditing Markdown语法高亮
  • SFTP SFTP支持
  • Solarized Color Scheme Solarized配色主题
  • Terminal 快捷打开终端
  • DocBlockr 快捷添加注释

Sublime Text 配置示例

{
	"color_scheme": "Packages/Solarized Color Scheme/Solarized (light).tmTheme",
	"file_exclude_patterns":
	[
		"*.pyc",
		"*.pyo",
		"*.exe",
		"*.dll",
		"*.obj",
		"*.o",
		"*.a",
		"*.lib",
		"*.so",
		"*.dylib",
		"*.ncb",
		"*.sdf",
		"*.suo",
		"*.pdb",
		"*.idb",
		".DS_Store",
		"*.class",
		"*.psd",
		"*.db",
		"*.sublime-workspace"
	],
	"folder_exclude_patterns":
	[
		".svn",
		".git",
		".hg",
		"CVS",
		"__pycache__"
	],
	"font_size": 11,
	"highlight_line": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"tab_size": 4,
	"theme": "Default.sublime-theme",
	"translate_tabs_to_spaces": true,
	"word_wrap": false
}

Terminal插件用户设置

首选项(N)->Package Settings->Terminal->Settings - User

{
    "terminal": "cmd"
}
posted @ 2018-12-03 18:49  七友!  阅读(105)  评论(0编辑  收藏  举报