vim Tab转空格

2017-03-10  本文已影响208人  谢昆明

默认Tab为4个空格

set ts=4
set sw=4
set expand tab```
##修改现有文件
####TAB替换为空格:
```:set ts=4
:set expandtab
:%retab!```
####空格替换为TAB:
```:set ts=4
:set noexpandtab
:%retab!```

>加!是用于处理非空白字符之后的TAB,即所有的TAB,
不加!,则只处理行首的TAB。

#打赏
如果这篇文章解决了您的问题,让我买根烟抽抽。

![支付宝.jpg](https://img.haomeiwen.com/i4765606/b13a42b44fd975a7.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/340)


![微信.jpg](https://img.haomeiwen.com/i4765606/3ad5592b17125067.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/340)
上一篇下一篇

猜你喜欢

热点阅读