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
- Select the lines by pushing
Ctrl+V
and and use eitherj
ork
or the arrow keys to select the lines you need to fix
- Select the lines by pushing
- Push
=
- Push
- Profit!!!!
All the lines you selected have been re-indented according to the current file syntax setting. All done.
Written by Christopher de Beer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#