🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 1.安装插件包package control [https://packagecontrol.io/installation\#st3](https://packagecontrol.io/installation#st3) ![](https://box.kancloud.cn/66a4dec6b759086c68f0e4daad56b46b_617x375.png) a.点击[view](/view)之后点击[show console![](https://box.kancloud.cn/432cbb12e77c1840e0d14d0dfec50e8e_656x538.png)](/show console),显示控制条 b.在控制台中粘贴以下代码 ``` 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) ``` ## 2.安装[前端插件](https://github.com/zhiqiang21/blog/issues/10) [https://github.com/zhiqiang21/blog/issues/10](https://github.com/zhiqiang21/blog/issues/10) ## 3.设置快捷键 ![](https://box.kancloud.cn/16e6ee1f11ff5548ebf9dc384c5c6ed2_651x390.png) 点击Preferences——之后点击key Bindings,将以下代码粘贴进去 ``` [ { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, { "keys": ["alt+/"], "command": "auto_complete" },//自动提示 { "keys": ["alt+up"], "command": "swap_line_up" },//整行上移 { "keys": ["alt+down"], "command": "swap_line_down" },//整行下移 { "keys": ["alt+left"], "command": "jump_back" },//跳转到上一个编辑处 { "keys": ["alt+right"], "command": "jump_forward" }, { "keys": ["ctrl+alt+j"], "command": "join_lines" }, { "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },//整行删除 { "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": //搜索全文 "find_in_files"} }, { "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, { "keys": ["ctrl+o"], "command": "show_overlay", "args": {"overlay": //跳转到当前的某个方法 "goto", "text": "@"} }, { "keys": ["ctrl+up"], "command": "goto_definition" },//跳转到定义,比如在某个函数上按此键,则跳转到它的定义。 { "keys": ["ctrl+down"], "command": "find_under_prev" },//选中光标所在的变量或者函数,非常有用 { "keys": ["ctrl+alt+down"], "command": "duplicate_line" },//向下复制整行 {"keys": ["ctrl+shift+l"], "command": "reindent" , "args":{"single_line": //格式化代码,当然也可以利用html+css+js prettify插件来格式化 false}}, { "keys": ["ctrl+shift+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, { "keys": ["ctrl+shift+s"], "command": "save_all" }, { "keys": ["ctrl+shift+f4"], "command": "close_all" }, { "keys": ["ctrl+shift+y"], "command": "lower_case" }, { "keys": ["ctrl+shift+x"], "command": "upper_case" } , { "keys": ["ctrl+w"], "command": "open_in_browser" }/*在浏览器中打开的快捷键*/ ] ```