aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-04-16 13:12:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-04-16 13:12:35 +1200
commitb29119f90d49e47bfee4c74a1fc452beb7ba134b (patch)
treec1a965cb8e26496c27d8a8e78dd5fae973270c7e /vim/vimrc
parentUse EDITOR in vis function (diff)
downloaddotfiles-b29119f90d49e47bfee4c74a1fc452beb7ba134b.tar.gz
dotfiles-b29119f90d49e47bfee4c74a1fc452beb7ba134b.zip
Strip trailing whitespace with <leader>x
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 50d36e91..768a86c2 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -175,6 +175,10 @@ if has('eval')
nnoremap <silent> <leader>t :<C-U>call ToggleFormatFlag('t')<CR>
endif
+" Strip trailing whitespace with \x
+nnoremap <silent> <leader>x
+ \ :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
+
" Keep plenty of command and search history, because disk space is cheap
set history=2000