我目前的设置是8个空格;我该如何重新定义它呢?
当前回答
或者vim modeline的简写:
vim :set ts=4 sw=4 sts=4 et :
其他回答
添加一行 将ts = 4 在 ~ /。每个用户的Vimrc文件 或 /etc/vimrc文件用于整个系统
还有一件事,使用 : retab 将现有制表符转换为空格 http://vim.wikia.com/wiki/Converting_tabs_to_spaces
永久为所有用户(当你独自在服务器上时):
# echo "set tabstop=4" >> /etc/vim/vimrc
在配置文件中追加设置。 通常在新服务器apt-get清除纳米mc和所有其他节省您的时间。否则,你将在git、crontab等中重新定义编辑器。
或者vim modeline的简写:
vim :set ts=4 sw=4 sts=4 et :
我基本的~/。Vimrc评论:
set number " show line number
set tabstop=2 " set display width of tab; 1 tab = x space with
set expandtab " transform tab to x space (x is tabstop)
set autoindent " auto indent; new line with number of space at the beginning same as previous
set shiftwidth=2 " number of space append to lines when type >>