In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely and readable. Is there a shortcut in Sublime 2 to do the same?
Indenting code in Sublime text 2
sublimetextsublimetext2
Related Topic
- How to force Sublime Text to indent two spaces per tab
- Sublime Text 2 – View whitespace characters
- Sublime Text 2 – Show file navigation in sidebar
- Limit File Search Scope in Sublime Text 2
- Sublime 3 – Set Key map for function Goto Definition
- How to select all instances of a variable and edit variable name in Sublime
- Replace \n with actual new line in Sublime Text
Best Answer
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 menuPreferences
→Keybindings
→User
, then add there:(example of using the F12 key for that functionality)
The config files use JSON-syntax, so these curly braces have to be placed comma-separated in the square-brackets that are there by default. If you don't have any other key-bindings already, then your whole
Keybindings
→User
file would look like this, of course: