7
4
When I do a search in vim, I like to have my results highlighted and super-visible, so I give them a bright yellow background and a black foreground in my .vimrc
.
" When highlighting search terms, make sure text is contrasting colors
:highlight Search guibg=yellow guifg=black
(This is for GUI versions of vim, like MacVim or Gvim; for command-line, you'd use ctermbg
and ctermfg
.)
But I sometimes use search with a command, as in c/foo
- "change from the cursor to the next occurrence of foo
."
In that case, I don't want all the occurrences of foo
to be highlighted.
Can I turn off highlighting only in cases where search is used as a movement for a command?
If there's no way to make this a default, is there a way to have an alternate search that doesn't highlight? Like, instead of
c/foo
,c//foo
, where//
is a non-highlighting search? – Nathan Long – 2012-08-15T15:17:56.117