Skip to content

Commit db3e8ca

Browse files
committed
Option to clear instead of toggle search highlighting
1 parent 0f62f12 commit db3e8ca

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.vimrc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,16 @@
299299
nmap <leader>f8 :set foldlevel=8<CR>
300300
nmap <leader>f9 :set foldlevel=9<CR>
301301
302-
" Toggle search highlighting
303-
nmap <silent> <leader>/ :set invhlsearch<CR>
302+
" Most prefer to toggle search highlighting rather than clear the current
303+
" search results. To clear search highlighting rather than toggle it on
304+
" and off, add the following to your .vimrc.before.local file:
305+
" let g:spf13_clear_search_highlight = 1
306+
if exists('g:spf13_clear_search_highlight')
307+
nmap <silent> <leader>/ :nohlsearch<CR>
308+
else
309+
nmap <silent> <leader>/ :set invhlsearch<CR>
310+
endif
311+
304312

305313
" Find merge conflict markers
306314
map <leader>fc /\v^[<\|=>]{7}( .*\|$)<CR>

0 commit comments

Comments
 (0)