diff options
author | Ekaitz Zárraga <ekaitz.zarraga@gmail.com> | 2016-04-01 16:29:06 +0200 |
---|---|---|
committer | Ekaitz Zárraga <ekaitz.zarraga@gmail.com> | 2016-04-01 16:29:06 +0200 |
commit | bb98bfb2d738ecdad448bf58c57f2ad2a680a8ce (patch) | |
tree | 650f371d87c2b6456a53fb44e7606e96949cc9cf /vim | |
parent | 3e706e9e918c1ca8353a07acc1750d46c3f85d0b (diff) |
Remove trailing spaces
Diffstat (limited to 'vim')
-rw-r--r-- | vim/.vimrc | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,3 +1,7 @@ +" Different config for each filetype +filetype plugin on + +" Show trailing spaces highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s\+$/ autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ @@ -5,15 +9,17 @@ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ autocmd InsertLeave * match ExtraWhitespace /\s\+$/ autocmd BufWinLeave * call clearmatches() - -filetype plugin on +" Clear trailing spaces on <F2> +function TrimWhiteSpace() + %s/\s*$// + '' +:endfunction +nnoremap <F2> :call TrimWhiteSpace()<CR> " Fold set foldmethod=syntax set foldlevelstart=99 - - " HighLight search and map CarrierReturn to remove highlight set hlsearch nnoremap <CR> :noh<CR><CR> |