我目前的设置是8个空格;我该如何重新定义它呢?
当前回答
我基本的~/。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 >>
其他回答
添加一行 将ts = 4 在 ~ /。每个用户的Vimrc文件 或 /etc/vimrc文件用于整个系统
对于永久的更改,创建文件~/.vim/plugin/tab_expander。用内容进行Vim
set tabstop=4 softtabstop=4 expandtab shiftwidth=4 smarttab
防止碰~/。Vimrc,从而保持其他默认设置不变。
确保vartabstop未设置
set vartabstop=
设置tabstop为4
set tabstop=4
:set sw=4
参见掌握VI编辑器
我基本的~/。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 >>
推荐文章
- 如何在Vim注释掉一个Python代码块
- 如何在可视块模式插入?
- 强迫自己掌握vi的最好方法是什么?
- 如何回到行之前编辑的最后一个在Vim?
- 如何跳转到一个特定的人物在vim?
- 如何删除一个大的文本块而不计算行?
- 在Vim/Vi中,如何将光标移动到前一个单词的末尾?
- 如何在vim中自动删除尾随空格
- 为什么Vim使用~扩展名保存文件?
- 如何在Vim或Linux中将空格转换为制表符?
- 我如何使用vimdiff来解决git合并冲突?
- 在Vim中删除当前缓冲区的文件名/路径
- Git在终端提交时打开VIM,但无法返回终端
- 请参阅编辑器中的换行符和回车
- 如何在NERDTree中显示隐藏文件(以句点开始)?