在Visual Studio中,我可以按Ctrl+K+D来缩进所有内容,因此代码结构很好,易于阅读。在Sublime 2中有捷径可以做到这一点吗?


当前回答

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} } 

您可以通过使用上面的代码获得reindent选项

其他回答

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} } 

您可以通过使用上面的代码获得reindent选项

Netbeans喜欢快捷键

转到首选项>键绑定>用户,并添加以下代码:

[
    { "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} }
]

使用

Ctrl + Shift + F

似乎没有人喜欢mac重缩进,所以我是这样做的:

[
   { "keys": ["command+shift+i"], "command": "reindent"}
]

在Preferences中> Key Binding -用户

还有一个额外的建议: 添加

{ "keys": ["command+0"], "command": "focus_side_bar" }

要有侧边栏文件树视图导航使用键盘。

注意: 如果您有多个{}对象集,则在每个{}的末尾添加

为了防止像我这样的人停止工作,在OS X中,命令键被标识为super,所以它应该能够做这样的事情:

[
    {
    "keys": ["super+i"], 
    "command": "reindent", 
    "args": {
        "single_line": 
        false}
    } 
]

在这种情况下,使用command+i将缩进你的整个代码(像eclipse一样:))

这很简单。点击编辑=>Line=>Reindent