I have a file with a lot of tabs that i need to set the tab spacing to 4 and expand out the tabs. I am able to set expandtab but it does not expand out the tabs for tabs already in the file.
Do the following
:se et
:se ts=4
:ret
The first command sets the expand tab, the second sets tab spacing to 4, and finally the third one re-tabs and converts tabs to spaces
"Super retab":
:retab
converts all sequences of tabstops or spaces, even those that might be in a "quoted string like this". This tip shows how to convert only the indents at the line beginnings. Any spaces or tabstops after the first non-white character are not affected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With