问题:ubuntu下vim如何设置tab为4个空格
解决:修改vimrc文件(个人home目录是.vim/.vimrc文件)
方法:
vim /etc/vim/vimrc
添加
set ts=4
set expandtab
现有文件
TAB替换为空格:
:set ts=4
:set expandtab
:%retab!
空格替换为TAB:
:set ts=4
:set noexpandtab
:%retab!
问题:ubuntu下vim如何设置tab为4个空格
解决:修改vimrc文件(个人home目录是.vim/.vimrc文件)
方法:
vim /etc/vim/vimrc
添加
set ts=4
set expandtab
现有文件
TAB替换为空格:
:set ts=4
:set expandtab
:%retab!
空格替换为TAB:
:set ts=4
:set noexpandtab
:%retab!