Last Updated: February 25, 2016
·
198
· christopherdebeer

Reindent a block of code

Say you hav a block of code in file you've just opened in vim and its indenting as all screwed either people where messing with tabs and spaces or both or had their IDE do something weird to the code, to fix this all you have to doo is

    1. Select the lines by pushing Ctrl+V and and use either jor k or the arrow keys to select the lines you need to fix
    1. Push =
    1. Profit!!!!

All the lines you selected have been re-indented according to the current file syntax setting. All done.