Is there any way to have vim highlight the search with /
and ?
but not when putting cursor on a word and pressing *
or #
?
:set hlsearch
and :set nohlsearch
turn it on and off for both.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI don't think there's anything better than switching highlight off just after the search:
set hlsearch
nnoremap <silent>* *:noh<CR>
nnoremap <silent># #:noh<CR>
set lazyredraw
if you still don't have it. But there's no guarantee it helps.
set lazyredraw
causes lots of lag, especially after vim has been open for a long time.
May 28, 2020 at 22:52
set incsearch honlsearch
and don't mess with it. You can try to raise an issue on Vim's github page.
Maybe you want to try this :
~/.vimrc
(create it if it didn't exist).Hope this will help.
hlsearch
but wants to temporarily disable while using the *
and #
commands that search for the word under the cursor...