Last active
September 11, 2015 06:22
-
-
Save hzhopen/b32fa5b31eb04cdb19c6 to your computer and use it in GitHub Desktop.
我的sublime插件说明
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我的sublime插件说明 | |
删除插件 | |
command + shift + p | |
输入remove package | |
选择要删掉的插件即可 | |
------------------------------ | |
Emmet | |
用字符缩写按tab键生成代码块 | |
------------------------------ | |
Gist | |
和github进行连接的插件,打造自己的代码或文本库,可以通过快捷键:新建: ⌘KI;打开:⌘KO;保存:⌘KS | |
------------------------------ | |
JsFormat | |
在你写javascript代码时,按下 Ctrl+Alt+f 快捷键后,js代码自动格式化对齐,赶快试一试吧! | |
如果你mac系统,上面的快键键不起作用的情况下,请尝试使用 control + option + f | |
如果mac系统上面的快键键还是不行....... 首先 command + a 全选你要格式化的代码,然后输入快键键 option + command +f (因为此快键键是针对选中行的格式化,所以前提是先 command + a 全选) | |
如果上面的快捷键使用无效,你可以选中要格式化的代码 ,然后按下 Ctrl+Alt+P (mac 系统 command + shift +p) 输入命令: Format:javascript 回车即可格式化. | |
------------------------------ | |
SublimeCodeIntel | |
一个非常强大的代码提示插件 按control+左键可以跳到函数 | |
------------------------------ | |
sublimeLinter | |
代码检查 | |
网上的配置例子: | |
{ | |
"sublimelinter": "save-only", | |
"sublimelinter_popup_errors_on_save": true, | |
"sublimelinter_executable_map": { | |
"javascript": "/usr/local/bin/node",//"D:/Program Files/nodejs/node.exe", | |
"css": ""/usr/local/bin/node"" | |
}, | |
"jshint_options": { | |
"strict": false, | |
"quotmark": "single", //只能使用单引号 | |
"noarg": true, | |
"noempty": true, //不允许使用空语句块{} | |
"eqeqeq": true, //!==和===检查 | |
"undef": true, | |
"curly": true, //值为true时,不能省略循环和条件语句后的大括号 | |
"forin": true, //for in hasOwnPropery检查 | |
"devel": true, | |
"jquery": true, | |
"browser": true, | |
"wsh": true, | |
"evil": true, | |
"unused": "vars", //形参和变量未使用检查 | |
"latedef": true, //先定义变量,后使用 | |
"globals": { | |
"grunt": true, | |
"module": true, | |
"window": true, | |
"jQuery": true, | |
"$": true, | |
"global": true, | |
"document": true, | |
"console": true, | |
"setTimeout": true, | |
"setInterval": true | |
} | |
}, | |
"csslint_options": { | |
"adjoining-classes": false, | |
"box-sizing": false, | |
"box-model": false, | |
"compatible-vendor-prefixes": false, | |
"floats": false, | |
"font-sizes": false, | |
"gradients": false, | |
"important": false, | |
"known-properties": false, | |
"outline-none": false, | |
"qualified-headings": false, | |
"regex-selectors": false, | |
"shorthand": false, | |
"text-indent": false, | |
"unique-headings": false, | |
"universal-selector": false, | |
"unqualified-attributes": false | |
} | |
} | |
------------------------------ | |
sublimerge | |
对比插件, | |
------------------------------ | |
SublimeEvernote | |
今天看了下Sublime_Evernote.py源码, 配置如下: | |
/* Sublime evernote default settings */ | |
{ | |
"authToken": "your dev authToken", | |
"noteStoreUrl": "your noteStore url" | |
} | |
这个插件发送代码到默认notebook里, 我们可以修改其代码, 可以默认,也可以输入notebook名字。其源码: | |
def sendnote(title,tags): | |
xh = XHTML() | |
note = Types.Note() | |
note.title = title.encode('utf-8') | |
note.content = '<?xml version="1.0" encoding="UTF-8"?>' | |
note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">' | |
note.content += '<en-note><pre>%s'%xh.p(content.encode('utf-8')) | |
note.content += '</pre></en-note>' | |
note.tagNames = tags and tags.split(",") or [] | |
try: | |
sublime.status_message("please wait...") | |
cnote = noteStore.createNote(authToken, note) | |
sublime.status_message("send success guid:%s"%cnote.guid) | |
sublime.message_dialog("success") | |
except Errors.EDAMUserException,e: | |
args = dict(title=title,tags=tags) | |
if e.errorCode == 9: | |
self.connect(self.send_note,**args) | |
else: | |
if sublime.ok_cancel_dialog('error %s! retry?'%e): | |
self.connect(self.send_note,**args) | |
except Exception,e: | |
sublime.error_message('error %s'%e) | |
createNote 方法为Evernote提供的api, 如果note对象没有指定notebookGuid, 则用默认notebook, 我们可以在代码里设置其guid为我们想要的notebookGuid。 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment