Replace tabs with spaces in Vim
Opened a file with tabs used instead of spaces? Even just one or two? Instead of feeling like an ogre on a rampage just use:
:retab
That's it, disaster averted ;-)
Dependency:
Make sure you have this set in your .vimrc:
:set noexpandtab
Written by Joe James
Related protips
3 Responses

That is so much better than using %s/\t/ /g!!!!
over 1 year ago
·

Note, that this only works if you have :set noexpandtab
over 1 year ago
·

Thanks @kid-icarus I've update the tip :-)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#