Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Created March 7, 2013 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joyrexus/5109538 to your computer and use it in GitHub Desktop.
Save joyrexus/5109538 to your computer and use it in GitHub Desktop.
Basic conventions for ~/.vim/ftplugin/python.vim.
" Language: Python
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
ab bang! #!/usr/bin/env python
" run tests in current file
nmap <LocalLeader>t :!nosetests %<CR>
" run/execute current file
nmap <LocalLeader>r :!python %<CR>
" run/execute specified line range
command! -range=% -bar R <line1>,<line2>:w !python -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment