Autoindentation in Sublime 2 text editor

autoindentindentationsublime-text-2

Is there an auto indentation option in Sublime 2?

In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely.
Is there a shortcut in Sublime 2 to do the same?

Best Answer

You can use the Edit / Line / Reindent from the edit menu. Or you could try adding this to your keybindings - Default file from preferences.

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

Add a comma at the end of the code if you use the Default file instead of the users. Don't forget to select what you want indented.

You could potentially just use Visual Studio to auto-indent more obscure data that SubT can't or doesn't do well.

Good luck && select the text you want to reindent.

Related Question