Skip to content

Instantly share code, notes, and snippets.

@mastensg
Created April 22, 2017 18:49
Show Gist options
  • Save mastensg/4edb12aac1829d6fbbb20f3e5aa47a19 to your computer and use it in GitHub Desktop.
Save mastensg/4edb12aac1829d6fbbb20f3e5aa47a19 to your computer and use it in GitHub Desktop.
~ $ cat .vim/ftplugin/python.vim
function! PythonFormat()
let l:w = winsaveview()
:%!autopep8 -
call winrestview(l:w)
endfunction
nmap <buffer> :call PythonFormat()<CR>
~ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment