Created
August 31, 2011 05:59
-
-
Save jordanorelli/1182910 to your computer and use it in GitHub Desktop.
ftplugin/python.vim - python-specific vim settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Python specific settings. | |
setlocal tabstop=4 | |
setlocal shiftwidth=4 | |
setlocal expandtab | |
setlocal autoindent | |
setlocal formatoptions=croql | |
nmap <F5> :w <CR> :!clear; python % <CR> | |
nmap <F6> :w <CR> :!python % | |
" set foldmethod=indent | |
let python_highlight_all=1 | |
" Use the below highlight group when displaying bad whitespace is desired. | |
highlight BadWhitespace ctermbg=red guibg=red | |
" Display tabs at the beginning of a line in Python mode as bad. | |
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/ | |
" Make trailing whitespace be flagged as bad. | |
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
put this in ~/.vim/ftplugin/python.vim and you're all set. (really it's $VIM/ftplugin/python.vim to be accurate)