Skip to content

Commit

Permalink
Improve searching
Browse files Browse the repository at this point in the history
Highlight all while typing in a search but then turn off hlsearch when
complete.
  • Loading branch information
duff committed Nov 2, 2017
1 parent 2d7aef7 commit bf9e284
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ set directory=~/.vim/tmp " where to keep swp files
" ----------------------------------------------------------------------------
" Searching
" ----------------------------------------------------------------------------
nnoremap / /\v
vnoremap / /\v
set ignorecase " make searches case insensitive
set smartcase " care about case sensitivity if there's a capital letter
set incsearch " do incremental searching
Expand Down Expand Up @@ -364,6 +362,17 @@ autocmd BufReadPost *
\ exe "normal! g`\"" |
\ endif


" --------------------------------------------------
" No hlsearch, but highlight all matches while searching
" --------------------------------------------------
augroup vimrc-incsearch-highlight
autocmd!
autocmd CmdlineEnter [/\?] :set hlsearch
autocmd CmdlineLeave [/\?] :set nohlsearch
augroup END


" --------------------------------------------------
" Omnicomplete
" --------------------------------------------------
Expand Down

0 comments on commit bf9e284

Please sign in to comment.