原文地址为:
ubuntu vim tab键改成4空格
转载请注明本文地址: ubuntu vim tab键改成4空格
set expandtab
对于已保存的文件,可以使用下面的方法进行空格和TAB的替换:
TAB替换为空格:
:set ts=4
:set expandtab
:%retab!
空格替换为TAB:
:set ts=4
:set noexpandtab
:%retab!
加!是用于处理非空白字符之后的TAB,即所有的TAB,若不加!,则只处理行首的TAB。
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set nu
set auto
indent
set cindent
Nu:表示显示行
转载请注明本文地址: ubuntu vim tab键改成4空格