My question is related to this post which for some reason was closed. Here's my .vimrc
file
set cpoptions=BceFs$ ":compatibility flags with /usr/ucb/vi
set hlsearch
hi Search ctermfg=white ctermbg=black cterm=NONE
hi IncSearch ctermfg=Black ctermbg=lightyellow cterm=bold,underline,reverse
nnoremap <esc> :noh<return><esc>
When I search, for a pattern it is highlighted; when I hit esc
, the highlighting is removed, however the arrow keys insert ABCD
.
When I remove the line nnoremap <esc> :noh<return><esc>
, I recover the default behavior of the arrow keys, but I lose the desired property of the esc
key.
Could somebody please explain how I can maintain the property that I want from the esc
key while preserving the default behavior of the arrow keys?
Some posts suggest that adding the line set nocompatible
to my .vimrc
file will fix the problem, but in my configuration, it doesn't. Still others suggest set term=cons25
, which doesn't work for me either.
Thanks for any suggestions!
esc
key rather than have the arrow keys work, but I imagine somehow it's possible to have both. If theesc
is the problem could you suggest another key remapping that I could use instead? I tried replacingesc
withdel
but it didn't work