Sublime / How to reformat (reindent) code automatically

You don't need any plugins to do this. Just select all lines (Ctrl + A) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains source code like .html or .rb or .py.

If you do this often, you may find this key mapping useful: 

{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }

More info: http://stackoverflow.com/questions/how-do-i-reformat-html-code-using-sublime

No comments:

Post a Comment