vim—自动缩进(编写Python脚本)
大神推荐使用vim编写Python脚本,学而时积之,不亦乐乎!
使用vim编写Python脚本的时候不能正常缩进,需要修改vimrc文件
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。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

更多精彩