From bb98bfb2d738ecdad448bf58c57f2ad2a680a8ce Mon Sep 17 00:00:00 2001 From: Ekaitz Zárraga Date: Fri, 1 Apr 2016 16:29:06 +0200 Subject: Remove trailing spaces --- vim/.vimrc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index e97b8c8..313a327 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -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\+\%#\@ +function TrimWhiteSpace() + %s/\s*$// + '' +:endfunction +nnoremap :call TrimWhiteSpace() " Fold set foldmethod=syntax set foldlevelstart=99 - - " HighLight search and map CarrierReturn to remove highlight set hlsearch nnoremap :noh -- cgit v1.2.3