Created
August 13, 2010 14:55
-
-
Save bartman/523005 to your computer and use it in GitHub Desktop.
This file contains 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
" strip spaces at the end of a line (almost working version) | |
function! ReturnStrip() | |
let p=getpos('.') | |
:s/\s\+$//e | |
exe ':s/\s\+\%' . p[2] . 'c//e' | |
call setpos('.', p) | |
normal! a^M | |
" ^^^ that's supposed to be a ^V<CR> | |
endfunction | |
imap <CR> <ESC>:call ReturnStrip()<CR>a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment