소스 검색

Don't add trailing whitespace to search history

Andrew Swistak 5 년 전
부모
커밋
9f4d732004
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      vimrc

+ 2 - 2
vimrc

@@ -401,11 +401,11 @@ hi MatchParen ctermfg=160 ctermbg=NONE cterm=underline guifg=#df0000 guibg=NONE
 function! DeleteTrailingWS()
   if !exists('b:noStrip')
     exe "normal mz"
-    %s/\s\+$//ge
+    keepp %s/\s\+$//ge
     exe "normal `z"
   endif
 endfunction
-au BufWrite * :call DeleteTrailingWS()
+au BufWritePre * :call DeleteTrailingWS()
 au FileType go let b:noStrip=1
 
 if !has("nvim")