divcsa
Last Updated: February 25, 2016
·
969
· joe_james

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

3 Responses
Add your response

4440

That is so much better than using %s/\t/ /g!!!!

over 1 year ago ·
4441

Note, that this only works if you have :set noexpandtab

over 1 year ago ·
4445

Thanks @kid-icarus I've update the tip :-)

over 1 year ago ·