Skip to content

Instantly share code, notes, and snippets.

@richo
Created May 20, 2015 18:07
Show Gist options
  • Select an option

  • Save richo/d11fd7fccb5a4164afc7 to your computer and use it in GitHub Desktop.

Select an option

Save richo/d11fd7fccb5a4164afc7 to your computer and use it in GitHub Desktop.
function! FixWhiteSpaceAndReturn()
if expand('%') == '.git/addp-hunk-edit.diff'
return
endif
normal mz
" Hack for my mail :/
:%s/^-- $/-- MARKER/e
:%s/\s\+$//e
:%s/^-- MARKER$/-- /e
normal `z
endfunction
autocmd BufWritePre * call FixWhiteSpaceAndReturn()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment