Last active
November 2, 2017 02:26
-
-
Save allenyang79/d551bdd6110e9628eb93b2535d2634a0 to your computer and use it in GitHub Desktop.
vim remove end empty line #vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TrimEndLines() | |
let cursor = getpos(".") | |
:%s#\($\n\s*\)\+\%$## | |
call setpos('.', cursor) | |
endfunction | |
au BufWritePre *.py call TrimEndLines() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment