sublime text2 node.js 开发配置

应用Package Control

调出 Console(Ctrl + `),输入下列代码,并执行。


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())

.

安装Emmet

调出 Package Control Install (Ctrl+Shift+P),输入 emmet,回车安装。

.

CoffeeScript 高亮

打开 Prefrences > Browse Packages。

  • 建立文件夹: CoffeeScript
  • 创建文件:CoffeeScript.tmLanguage
  • 复制代码: https://github.com/jashkenas/coffee-script-tmbundle/blob/master/Syntaxes/CoffeeScript.tmLanguage

.

常用配置修改

个人习惯

  • 单行注释:Ctrl+'
  • 块注释:Ctrl+Shift+'
  • 自动补全:Ctrl+;

打开 Prefrences > Key Binds - User, 输入下列信息:

<!-- lang: js -->
[
    { "keys": ["ctrl+'"], "command": "toggle_comment", "args": { "block": false } },
    { "keys": ["ctrl+shift+'"], "command": "toggle_comment", "args": { "block": true } },

    { "keys": ["ctrl+;"], "command": "auto_complete" },
    { "keys": ["ctrl+;"], "command": "replace_completion_with_auto_complete", "context":
        [
            { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
            { "key": "auto_complete_visible", "operator": "equal", "operand": false },
            { "key": "setting.tab_completion", "operator": "equal", "operand": true }
        ]
    },

    {
        "keys": [
            "ctrl+shift+backspace"
        ], 
        "args": {
            "action": "remove_tag"
        }, 
        "command": "run_emmet_action", 
        "context": [
            {
                "key": "emmet_action_enabled.remove_tag"
            }
        ]
    },

    {
        "keys": [
            "ctrl+alt+]"
        ], 
        "args": {
            "action": "matching_pair"
        }, 
        "command": "run_emmet_action", 
        "context": [
            {
                "key": "emmet_action_enabled.matching_pair"
            }
        ]
    }
]

你可能感兴趣的:(sublime,node.js,CoffeeScript,开发配置)