16

I have changed my Vim colours so when I do a /search, every match is highlighted in bright yellow. This makes matches much easier to see.

However, when I perform a substitution with the confirm flag like :%s/find/replace/gc all the items are highlighted in yellow, which is fine, but I can't tell which item Vim is asking me to confirm.

How can I highlight the current substitution item in another colour so I can see what needs confirming?

Heptite
  • 20,411
jordelver
  • 2,361

2 Answers2

10

The highlight group you want is "IncSearch" even if you don't have the the 'incsearch' option enabled—it is also used for the current substitution when confirmation is enabled.

See ":help hl-IncSearch".

Heptite
  • 20,411
7

When inside vim you can use the command mode:
:highlight IncSearch guibg=green ctermbg=green term=underline

To have it always, put this into your .vimrc:
highlight IncSearch guibg=green ctermbg=green term=underline

p1100i
  • 1,010