Răsfoiți Sursa

Remove incremental search vim plugin

This plugin was causing macros that relied on searching to position the cursor
to run slow.

Also:
 - Re-add backspace-to-clear-search-highlighting to vimrc.
Weiyi Lou 10 ani în urmă
părinte
comite
e20cb69548
3 a modificat fișierele cu 11 adăugiri și 16 ștergeri
  1. 0 15
      vim/settings/incsearch.vim
  2. 10 0
      vim/vimrc
  3. 1 1
      vim/vimrc.bundles

+ 0 - 15
vim/settings/incsearch.vim

@@ -1,15 +0,0 @@
-" incsearch.vim: Improved incremental searching
-
-" Basic Usage
-map /  <Plug>(incsearch-forward)
-map ?  <Plug>(incsearch-backward)
-map g/ <Plug>(incsearch-stay)
-
-" Autoremove search highlighting
-let g:incsearch#auto_nohlsearch = 1
-map n  <Plug>(incsearch-nohl-n)
-map N  <Plug>(incsearch-nohl-N)
-map *  <Plug>(incsearch-nohl-*)
-map #  <Plug>(incsearch-nohl-#)
-map g* <Plug>(incsearch-nohl-g*)
-map g# <Plug>(incsearch-nohl-g#)

+ 10 - 0
vim/vimrc

@@ -101,6 +101,16 @@ nnoremap <silent> <leader>l :set list!<CR>
 " Toggle scrollbind for moving multiple splits in sync together
 nnoremap <silent> <leader>s :set scrollbind! scrollbind?<CR>
 
+" Backspace to clear current search (and stop highlighting)
+nnoremap <silent> <backspace> :call ClearSearch()<CR>
+
+function! ClearSearch()
+  if (@/ != "")
+    let @/=""
+    redraw
+  endif
+endfunction
+
 " Allow using the repeat operator with a visual selection (!)
 " http://stackoverflow.com/a/8064607/127816
 vnoremap . :normal .<CR>

+ 1 - 1
vim/vimrc.bundles

@@ -55,7 +55,7 @@ Bundle 'tpope/vim-fugitive'
 Bundle 'scrooloose/nerdcommenter'
 Bundle 'godlygeek/tabular'
 Bundle 'tristen/vim-sparkup'
-Bundle 'haya14busa/incsearch.vim'
+"Bundle 'haya14busa/incsearch.vim'
 "Bundle 'katono/rogue.vim'
 
 " Text Objects {{{