2-vim—Ubuntu中配置自动缩进

大神推荐使用vim编写Python脚本,学而时积之,不亦乐乎!

使用vim编写Python脚本的时候不能正常缩进,需要修改vimrc文件

Ubuntu系统下vimrc文件的位置:

$ cd /etc/vim/

$ sudo vim vimrc

添加如下到vimrc文件

set filetype=python
au BufNewFile,BufRead *.py,*.pyw setf python set autoindent " same level indent set smartindent " next level indent set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4



原文地址:https://www.cnblogs.com/summer1019/p/10338059.html