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.
Bookmark this question. Show activity on this post. In Sublime Text 3,when we press Ctrl+Shift+B, we are given the option to either do "Build and Run" or "only Build", whereas Ctrl+B executes the previously chosen operation among the two.
The shortcut key for this purpose is Ctrl+Shift+P for Windows and Cmd+Shift+P for Mac.
To quickly duplicate a line of code, place the cursor anywhere in the line and hit Cmd–Shift–D(Mac) or Ctrl–Shift–D (Windows).
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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With