diff options
Diffstat (limited to '.vim/custom-functions.vim')
-rw-r--r-- | .vim/custom-functions.vim | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/.vim/custom-functions.vim b/.vim/custom-functions.vim deleted file mode 100644 index ecf92bd..0000000 --- a/.vim/custom-functions.vim +++ /dev/null @@ -1,37 +0,0 @@ -" ================ strip trailing whitespaces ================ -" via: http://rails-bestpractices.com/posts/60-remove-trailing-whitespace -" Strip trailing whitespace -function! <SID>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 <SID>StripTrailingWhitespaces() -nmap ,w :StripTrailingWhitespaces<CR> -" ================ 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()<CR> - -vmap <D-j> gj -vmap <D-k> gk -vmap <D-$> g$ -vmap <D-^> g^ -vmap <D-0> g^ -nmap <D-j> gj -nmap <D-k> gk -nmap <D-$> g$ -nmap <D-^> g^ -nmap <D-0> g^ - |