From 446da5d8ca8f8e7d69475f0cb0a3e1cf92ed94d7 Mon Sep 17 00:00:00 2001 From: Anastasios Zouzias Date: Fri, 3 Aug 2018 12:52:12 +0200 Subject: [PATCH] fix python configs --- my_configs.vim | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/my_configs.vim b/my_configs.vim index 0f44cd1e..da482ebc 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -1,16 +1,38 @@ + +" Python + +highlight BadWhitespace ctermbg=red guibg=red + +" Python, PEP-008 +au BufRead,BufNewFile *.py,*.pyw set expandtab +au BufRead,BufNewFile *.py,*.pyw set textwidth=139 +au BufRead,BufNewFile *.py,*.pyw set tabstop=4 +au BufRead,BufNewFile *.py,*.pyw set softtabstop=4 +au BufRead,BufNewFile *.py,*.pyw set shiftwidth=4 +au BufRead,BufNewFile *.py,*.pyw set autoindent +au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/ +au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /\s\+$/ +au BufNewFile *.py,*.pyw let fileformat=unix +au BufRead,BufNewFile *.py,*.pyw let b:comment_leader = '#' + +autocmd BufWritePost *.py call Flake8() + +let g:flake8_show_in_gutter=1 " show + + " How can I open a NERDTree automatically when vim starts up if no files were specified? - autocmd StdinReadPre * let s:std_in=1 - autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif - " How can I map a specific key or shortcut to open NERDTree? - map :NERDTreeToggle - - " How can I close vim if the only window left open is a NERDTree? - autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree. isTabTree()) | q | endif +" How can I map a specific key or shortcut to open NERDTree? +map :NERDTreeToggle + +" How can I close vim if the only window left open is a NERDTree? +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree. isTabTree()) | q | endif -" Easier split navigations +" Easier VIM split navigations nnoremap nnoremap nnoremap