What's wrong with this mapping? Vim starts up - REPLACE - mode
I have a strange error in mine .vimrc
since I last updated it.
Every time I start vim it starts up in mode -- REPLACE --
which is really annoying.
I was able to figure out what exactly this line in mine .vimrc
is causing the problem.
" Disable search highlighting temporally
nnoremap <esc> :nohl<cr>
The problem goes away when I comment out this line.
I'm really confused about what's wrong with the display. It works as it should, but forces vim to enter -- REPLACE --
mode at startup.
I currently have no plugins.
source to share
It is best not to display the key Escas it is known to cause strange behavior:
- How to match <Esc> to quit vim-vim, immediately after opening opens if displayed: q <CR>
- Displaying <esc> in vimrc causes bizzare arrow behavior
I used <leader><space>
to turn off the backlight as suggested by "Coming Home to Vim" , maybe you can get used to it too.
source to share
I had the same problem, although it was inside tmux, when I ran vi (aka vim) it started in REPLACE mode. It looks like the culprit is the TERMCAP definitions for TERM I used: xterm-256color.
Once I set TERM to something else, vi (vim) worked correctly. Even the TERM "ansi" setting behaved better.
I settled on the "screen-256color-s" TERM setting, which works as I need it to.
Fun with TERMCAP definitions.
source to share