How to match <Esc> to quit vim-vim, immediately after opening opens if displayed: q <CR>

I put this line in my .vimrc so that I can press escape to exit vim normally:

:nnoremap <Esc> :q<CR>

But now $ vim

causes vim to flash instantly and then exit every time. The same with $ vim filename

.

Deleting the line restores normal behavior. Is there a way to get this functionality? I'm pretty sure I've worked on this before, but can't figure out why it broke between now and then.

+1


source to share


2 answers


Vim may experience some very strange behavior when reassigning <Esc>

. I would recommend using a different key for this unless you need a headache.



See this question for reference: Displaying <esc> in vimrc causes bizzare arrow behavior

+2


source


Adding :set t_RV= ttymouse=xterm2

to .vimrc fixes the problem (see https://superuser.com/questions/553601/ ).



0


source







All Articles