diff options
author | Tharre <tharre3@gmail.com> | 2017-09-22 05:43:08 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2017-09-22 05:43:08 +0200 |
commit | e00f5276dc6e7d9af446003e0dbfa1e8ccba3194 (patch) | |
tree | 011d5e82aedee45f5b782dc0a3ea573b64917e0e /.vimrc | |
parent | 9e49c4b66f5151014dc5e95f5f1fcb33af987d41 (diff) | |
download | dotfiles-e00f5276dc6e7d9af446003e0dbfa1e8ccba3194.tar.gz dotfiles-e00f5276dc6e7d9af446003e0dbfa1e8ccba3194.tar.xz dotfiles-e00f5276dc6e7d9af446003e0dbfa1e8ccba3194.zip |
vim: strip whitespaces with F5 instead of on save
The code was taken from [0].
[0] https://vi.stackexchange.com/questions/454/
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -81,8 +81,8 @@ map Q @ map <S-m> :tabprevious<CR> map m :tabnext<CR> -" remove trailing whitespaces on save -autocmd BufWritePre * :%s/\s\+$//e +" map F5 to removing trailing whitespace +nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR> " save file with root permissions cmap w!! w !sudo tee % >/dev/null |