linux vim 设置 python 自动缩进

来源:互联网 发布:韦志中网络班骗局 编辑:程序博客网 时间:2024/05/06 04:25

在ubuntu中的Vim中设置python的自动缩进:

1。编辑vimrc文件: 输入命令

vim /etc/vim/vimrc/

2.贴入如下代码 保存即可(测试基本上可以 if好像有点问题)


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

希望有答案的可以一起完善!


0 0