开发者

Expand Tabs in VIM

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 bu开发者_运维问答t 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜