From 385edc5dad3063856efb67d62dea134e93a2ce2b Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 2 Mar 2016 18:20:03 +0100 Subject: [PATCH] [vim]use filetype for python autocmd --- .vimrc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.vimrc b/.vimrc index cd194fb..ffaf7c5 100644 --- a/.vimrc +++ b/.vimrc @@ -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")