vim tab键默认4空格

为了vim更好的支持python写代码,修改tab默认4个空格有两种设置方法:

1. vim /etc/vimrc

[shell]
set ts=4
set sw=4
[/shell]

2. vim /etc/vimrc

[shell]
set ts=4
set expandtab
set autoindent
[/shell]

推荐使用第二种,按tab键时产生的是4个空格,这种方式具有最好的兼容性。

发表评论