Skip to content

Instantly share code, notes, and snippets.

@sean-d
Created July 29, 2015 20:05
Show Gist options
  • Save sean-d/46b8f77594f5c0c6e681 to your computer and use it in GitHub Desktop.
Save sean-d/46b8f77594f5c0c6e681 to your computer and use it in GitHub Desktop.
python vim specifics
setlocal tabstop=4
" column highlight for pep8; thou shall not pass 79 columns
highlight ColorColumn ctermbg=090
let &colorcolumn=join(range(80,80),",")
" set text width, tabs, and other goodies for Python
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=79
setlocal smarttab
setlocal expandtab
"execute Python from within: F11 for Py3 / F12 for Py2
nnoremap <buffer> <F12> :exec '!python' shellescape(@%, 1)<cr>
nnoremap <buffer> <F11> :exec '!python3' shellescape(@%, 1)<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment