[vim]use filetype for python autocmd

This commit is contained in:
Mathieu Maret 2016-03-02 18:20:03 +01:00
parent ca1ea2e785
commit 385edc5dad
1 changed files with 8 additions and 10 deletions

18
.vimrc
View File

@ -129,17 +129,15 @@ set shiftwidth=8
if has("autocmd")
" python
" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
autocmd BufRead,BufNewFile *.py syntax on
autocmd BufRead,BufNewFile *.py set ai
autocmd BufRead,BufNewFile *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd BufRead,BufNewFile *.py set tabstop=4
autocmd BufRead,BufNewFile *.py set expandtab
autocmd BufRead,BufNewFile *.py set shiftwidth=4
autocmd BufRead,BufNewFile *.py set softtabstop=4
autocmd BufRead,BufNewFile *.py set modeline
autocmd BufRead,BufNewFile *.py set ft=python
autocmd Filetype python set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd Filetype python set tabstop=8
autocmd Filetype python set expandtab
autocmd Filetype python set shiftwidth=4
autocmd Filetype python set softtabstop=4
autocmd Filetype python set modeline
" Indentation with = for python need autopep8
autocmd BufRead,BufNewFile *.py set equalprg=autopep8\ -
autocmd Filetype python set equalprg=autopep8\ -
endif
if has("autocmd")