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