轉自 http://www.douban.com/note/276794943/html
[ /** * 經常使用快捷鍵(Sublime默認) * -------------- * * 光標一個單詞一個單詞的移動 * { "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} }, * 按住shift來選文字時, 一個個單詞的選而不是一個個字母 * { "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} }, * * 相似光標一個個單詞的移動 * { "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} }, * { "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} }, * * 縮進 * { "keys": ["ctrl+]"], "command": "indent" }, * { "keys": ["ctrl+["], "command": "unindent" }, * * 刪除整個單詞 * { "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false } }, * { "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true } }, * * 行排序(例如選中幾個JSON字段, 讓這些字段名按字母順序排序) * { "keys": ["f9"], "command": "sort_lines", "args": {"case_sensitive": false} }, * * 參考 * ---------------------- * Using Sublime Text as your IDE * http://www.chromium.org/developers/sublime-text * * Web Development With Sublime Text 2 * http://www.paulund.co.uk/web-development-with-sublime-text-2 */ // editor配置 { "keys": ["ctrl+v"], "command": "paste_and_indent" }, { "keys": ["ctrl+shift+v"], "command": "paste" }, /** * 適配eclipse快捷鍵 * * 下面這位仁兄早就有了這個想法 * Eclipse shortcuts for Sublime Text 2 * http://icoloma.blogspot.com/2011/10/eclipse-shortcuts-for-sublime-text-2.html */ { "keys": ["alt+/"], "command": "auto_complete" }, { "keys": ["ctrl+i"], "command": "reindent" }, // 當前行和下面一行交互位置 { "keys": ["alt+up"], "command": "swap_line_up" }, { "keys": ["alt+down"], "command": "swap_line_down" }, // 複製當前行到上一行 { "keys": ["ctrl+alt+up"], "command": "duplicate_line" }, // 複製當前行到下一行 { "keys": ["ctrl+alt+down"], "command": "duplicate_line" }, // 刪除整行 { "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, // 光標移動到指定行 { "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, // 快速定位到選中的文字 { "keys": ["ctrl+k"], "command": "find_under_expand_skip" }, // { "keys": ["ctrl+shift+x"], "command": "swap_case" }, { "keys": ["ctrl+shift+x"], "command": "upper_case" }, { "keys": ["ctrl+shift+y"], "command": "lower_case" }, // 在當前行的下一行插入空行(這時鼠標能夠在當前行的任一位置, 不必定是最後) { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, // 定位到對於的匹配符(譬如{})(從前面定位後面時,光標要在匹配符裏面,後面到前面,則反之) { "keys": ["ctrl+shift+p"], "command": "move_to", "args": {"to": "brackets"} }, // 這個命令默認使用的是ctrl+shift+p { "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} }, // outline { "keys": ["ctrl+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, // 當前文件中的關鍵字(方便快速查找內容) { "keys": ["ctrl+alt+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} }, // open resource { "keys": ["ctrl+shift+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, // 文件內查找/替換 { "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "replace"} }, // 全局查找/替換, 在查詢結果中雙擊跳轉到匹配位置 {"keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "find_in_files"} }, // plugin配置 { "keys": ["alt+a"], "command": "alignment" }, {"keys": ["ctrl+shift+f"], "command": "js_format"} ]
設置web
{ "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme", "dpi_scale": 1, "font_size": 11, "hot_exit": false, "ignored_packages": [ "Vintage" ], "remember_open_files": false, "update_check": false }
安裝插件:shell
安裝Sublime text 2插件很方便,能夠直接下載安裝包解壓縮到Packages目錄(菜單->preferences->packages)。sublime-text
也能夠安裝package control組件,而後直接在線安裝:網絡
按Ctrl+`調出console(注:安裝有QQ輸入法的這個快捷鍵會有衝突的,輸入法屬性設置-輸入法管理-取消熱鍵切換至QQ拼音)eclipse
粘貼如下代碼到底部命令行並回車:
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())ui
重啓Sublime Text 2。url
若是在Perferences->package settings中看到package control這一項,則安裝成功。spa
若是這種方法不能安裝成功,能夠到這裏下載文件手動安裝。.net
按下Ctrl+Shift+P調出命令面板
輸入install 調出 Install Package 選項並回車,而後在列表中選中要安裝的插件。
不爽的是,有的網絡環境可能會不容許訪問陌生的網絡環境從而設置一道防火牆,而Sublime Text 2貌似沒法設置代理,可能就獲取不到安裝包列表了。
經常使用插件:JSFormat ConvertToUTF
添加到右鍵菜單:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\SublimeText3] @="Open with SublimeText" "Icon"="E:\\Sublime Text Build 3176 x64\\sublime_text.exe,0" [HKEY_CLASSES_ROOT\*\shell\SublimeText3\command] @="E:\\Sublime Text Build 3176 x64\\sublime_text.exe %1" [HKEY_CLASSES_ROOT\Directory\shell\SublimeText3] @="Open with SublimeText" "Icon"="E:\\Sublime Text Build 3176 x64\\sublime_text.exe,0" [HKEY_CLASSES_ROOT\Directory\shell\SublimeText3\command] @="E:\\Sublime Text Build 3176 x64\\sublime_text.exe %1"
添加以上代碼到add.reg,修改代碼中的路徑位置,並執行
去除右鍵菜單
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\*\shell\SublimeText3] [-HKEY_CLASSES_ROOT\Directory\shell\SublimeText3]