daily pastebin goal
91%
SHARE
TWEET

Untitled

a guest Sep 12th, 2018 55 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. Apply automatic pep8 fixes from QuickFix window
  2. $ autopep8 --in-place spam.py
  3. $ git difftool spam.py  # check edits in gVim, write to file
  4. $ git commit spam.py -m "Fix bad PEP8 formatting"
  5.    
  6. " copy this to your vimrc or source it
  7.  
  8. " tells vim not to automatically reload changed files
  9. set noautoread
  10.  
  11. function! DiffWithSaved()
  12.   let filetype=&ft
  13.   diffthis
  14.   vnew | r # | normal! 1Gdd
  15.   diffthis
  16.   exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype
  17. endfunction
  18.  
  19. " sets up mappings to function
  20.  
  21. com! DiffSaved call DiffWithSaved()
  22. map <Leader>ds :DiffSaved<CR>
  23.    
  24. " run these commands after sourcing the above function
  25.  
  26. " % expands to filename (also %:h to head, %:t to tail)
  27. " if it throws an error, just do :cd %:h first
  28.  
  29. :!autopep8 --in-place %
  30. :DiffSaved
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top