" ================ strip trailing whitespaces ================ " via: http://rails-bestpractices.com/posts/60-remove-trailing-whitespace " Strip trailing whitespace function! StripTrailingWhitespaces() " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " Do the business: %s/\s\+$//e " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction command! StripTrailingWhitespaces call StripTrailingWhitespaces() nmap ,w :StripTrailingWhitespaces " ================ text wrapping ================ " http://vimcasts.org/episodes/soft-wrapping-text/ function! SetupWrapping() set wrap linebreak nolist set showbreak=… endfunction " TODO: this should happen automatically for certain file types (e.g. markdown) command! -nargs=* Wrap :call SetupWrapping() vmap gj vmap gk vmap g$ vmap g^ vmap g^ nmap gj nmap gk nmap g$ nmap g^ nmap g^