What is wrong with this mapping? Vim starts in -- REPLACE -- mode

It is better to avoid mapping the Esc key, as it is known to cause strange behavior:

  • How to map < Esc > to quit vim - vim quits immediately after opening if mapped to :q< CR >
  • Mapping < esc > in vimrc causes bizzare arrow behaviour

I have been using <leader><space> for disabling the highlighting, as suggested by "Coming Home to Vim", maybe you could get used to it too.


I had this same problem, though it was inside of tmux, when I started vi (aka vim), it would launch in REPLACE mode. The culprit seems to be the TERMCAP definitions for the TERM I have been using: xterm-256color.

Once I set TERM to something different, vi (vim) worked correctly. Even a TERM setting of "ansi" behaved better.

I settled on a TERM setting of "screen-256color-s" which works as I need.

Fun with TERMCAP definitions.

Tags:

Vim