Autoindent On Sublime Text


Answer :

That's quite simple in Sublime. Just Ctrl+Shift+P (or Command+Shift+P on MacOS) to open the tools pallet, type reindent, and pick Indentation: Reindent Lines. It should reindent all the file you are in, just remember to save before running the command, or it may not appear.


Auto-indenting on Sublime Text 3 - "Key Bindings"

Just add this binding to your "Key Bindings - User" file:

Preferences > Key Bindings - users

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

And adding this code between the square brackets.

Now you can use Alt + Shift + f as your auto-indent shortcut

You can also use the "reindent" feature through the command palette. Ctrl + Shift + P


Ressources:

Auto-indenting on Sublime Text 3 by Osvaldo Zonetti

Create a Keybinding by Joe Lloyd


You can use one of many plugins which do the thing you need, for example, the one I am using:

  • https://github.com/akalongman/sublimetext-codeformatter

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?