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.
I even tried to add
– Chris Heithoff Sep 28 '21 at 17:07normal Rat the end of my ~/.vimrc and Vim opened in NORMAL mode.<esc>! (at least not until Vim has finally started up) https://vi.stackexchange.com/a/2620/71 – Christian Brabandt Sep 28 '21 at 17:51