reindent shortcut in sublime text [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-20 07:59:25

问题


Possible Duplicate:
Indenting code in Sublime text 2?

I'm trying to learn keyboard shortcuts in Sublime. What is the keyboard shortcut in Sublime Text 2 for reindent? According to some pages it should be TAB but that only indents, not reindents.


回答1:


You can find it in Edit>>Line>>Reindent, but it does not have a shortcut by default. You can add a shortcut by going to the menu Preferences - Keybindings-User, then add there (the config file takes as a JSON format):

[
    { "keys": ["f12"], "command": "reindent"} 
]

(example of using the F12 key for that functionality)




回答2:


I use cmd-[ and cmd-] for indenting but I am not sure exactly what you mean by "reindent"...

Ahh, OK I get your question now, you can use the command to re-calculate and apply correct indentation to a file. For example, if you open a file that has had been programmatically altered and had whitespace stripped or tabs removed you would use the reindent command to restore correct formatting.



来源:https://stackoverflow.com/questions/12182896/reindent-shortcut-in-sublime-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!