1

I've enabled hlsearch to highlight text after searching,

$ grep hlsearch ~/.vimrc
set hlsearch

and now I want to clear the highlight, which I can do with :noh. I saw that I can assign this to esc key in normal mode with this:

$ grep noh ~/.vimrc
nnoremap <silent> <esc> :noh<cr><esc>

Now everytime I open vim, it opens in -- REPLACE -- mode. How can I fix this?

The version of vim:

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 15 2021 21:48:21)
Included patches: 1-3441
Compiled by Arch Linux
Huge version without GUI.
Amir Shabani
  • 191
  • 6

0 Answers0