divcsa
Last Updated: February 25, 2016
·
907
· joe_james
Mug

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
Say Thanks
Respond

3 Responses
Add your response

4440
9f00d62b090e36871d77c634ae5e0c59

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

over 1 year ago ·
4441
9f00d62b090e36871d77c634ae5e0c59

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

over 1 year ago ·
4445
Mug

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

over 1 year ago ·