I just got a Kinesis Advantage keyboard and want to remap Enter to Esc in insert mode in vim. I'm using iTerm2 as well.
Here's what I've got so far:
inoremap <CR> <Esc>
inoremap jj <Esc>
nnoremap <CR> i
On startup, this does not work: Enter enters insert mode, and in insert mode, jj
exits insert mode. However, Enter does not exit from insert mode.
Then I reload my vimrc file:
:so $MYVIMRC
And viola, my Enter key now exits insert mode and everything works fine.
Any thoughts on why this would be happening?
Thanks
:verbose imap <cr>
" show? – Heptite Aug 24 '16 at 23:58i <CR> * pumvisible() ? "\<C-N>" : "\<CR>" Last set from ~/vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
, and after:i <CR> * <Esc> Last set from ~/.vimrc
. Thank you! Want to make an answer and I'll accept it? – thekevinscott Aug 25 '16 at 13:06