diff --git a/nvim/.config/nvim/after/plugin/incsearch.vim b/nvim/.config/nvim/after/plugin/incsearch.vim deleted file mode 100644 index 8f8d093..0000000 --- a/nvim/.config/nvim/after/plugin/incsearch.vim +++ /dev/null @@ -1,9 +0,0 @@ -map / (incsearch-forward) -map ? (incsearch-backward) -map g/ (incsearch-stay) -map n (incsearch-nohl-n) -map N (incsearch-nohl-N) -map * (incsearch-nohl-*) -map # (incsearch-nohl-#) -map g* (incsearch-nohl-g*) -map g# (incsearch-nohl-g#) diff --git a/nvim/.config/nvim/autocmd.vim b/nvim/.config/nvim/autocmd.vim index 55badc4..24611a6 100644 --- a/nvim/.config/nvim/autocmd.vim +++ b/nvim/.config/nvim/autocmd.vim @@ -9,6 +9,11 @@ augroup ResizeWindowsProportionally autocmd VimResized * :wincmd = augroup END +augroup ToggleSearchHighlighting + autocmd! + autocmd InsertEnter * setlocal nohlsearch +augroup END + augroup UserStatusline autocmd! autocmd BufEnter,WinEnter,TermOpen * setlocal statusline=%!ActiveStatus() diff --git a/nvim/.config/nvim/colors/molokai.vim b/nvim/.config/nvim/colors/molokai.vim index 7a52fe4..a43f0a7 100644 --- a/nvim/.config/nvim/colors/molokai.vim +++ b/nvim/.config/nvim/colors/molokai.vim @@ -115,6 +115,8 @@ hi NonText guifg=#465457 hi SpecialKey guifg=#465457 hi Conceal guifg=#f92672 guibg=bg +hi Searchlight guifg=#FF00FF guibg=#000000 + " Must be at the end, because of ctermbg=234 bug. " https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ set background=dark diff --git a/nvim/.config/nvim/colors/wombat.vim b/nvim/.config/nvim/colors/wombat.vim index cda8c4e..49e6a6f 100644 --- a/nvim/.config/nvim/colors/wombat.vim +++ b/nvim/.config/nvim/colors/wombat.vim @@ -92,5 +92,7 @@ hi link MoreMsg Question hi ModeMsg guifg=#F6F3E8 guibg=NONE gui=NONE +hi Searchlight guifg=#FF00FF guibg=#000000 + " Custom stuff hi Modified guifg=black guibg=#FFA500 diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 05371b1..541d2cf 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -5,7 +5,7 @@ Plug 'justinmk/vim-sneak' " Search Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' -Plug 'haya14busa/incsearch.vim' +Plug 'PeterRincker/vim-searchlight' Plug 'wincent/ferret' " Remove extraneous whitespace when edit mode is exited Plug 'axelf4/vim-strip-trailing-whitespace' diff --git a/nvim/.config/nvim/keymappings.vim b/nvim/.config/nvim/keymappings.vim index 24c8b0c..789b060 100644 --- a/nvim/.config/nvim/keymappings.vim +++ b/nvim/.config/nvim/keymappings.vim @@ -126,11 +126,21 @@ nnoremap :WhichKey ',' nnoremap :vsp :exec("tag ".expand("")) nnoremap :sp :exec("tag ".expand("")) +" Use Tab & S-Tab instead of C-g and C-t for incsearch +cno getcmdtype() =~ '[?/]' ? '' : feedkeys('', 'int')[1] +cno getcmdtype() =~ '[?/]' ? '' : feedkeys('', 'int')[1] +nnoremap n :nohlsearch + " Move across wrapped lines like regular lines " Go to the first non-blank character of a line noremap 0 ^ " Just in case you need to go to the very beginning of a line noremap ^ 0 +" Centre the window on each search movement +nnoremap n nzz +nnoremap N Nzz +vnoremap n nzz +vnoremap N Nzz " Make dot work on visually selected lines vnoremap . :norm.