Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Ideavim how to set key map for <ESC>

In my ~/.ideavimrc I set

noremap jj <Esc>

To remap "jj" to escape (to enter normal mode).

However it doesn't seem to be working? .ideavimrc is in the same location as my .vimrc and I restarted IntelliJ.

like image 696
redconservatory Avatar asked Aug 29 '14 01:08

redconservatory


3 Answers

I found the solution on the ideaVim twitter page. To set jj to you will need to include the following in your ~/.ideavimrc. This works for me using Jetbrains software. You need to set the timeoutlen so it know when to stop looking for the next char in the sequence.

imap jj <Esc>
set timeoutlen=1000

Twitter Link -- https://twitter.com/ideavim/status/512932112765562880?lang=en

like image 143
rmkr Avatar answered Oct 24 '22 09:10

rmkr


I am not aware whether something changed since this question was asked, but this works perfectly fine for me:

imap jj <Esc>

like image 21
Erik Johansson Avatar answered Oct 24 '22 08:10

Erik Johansson


Add the following line in your ~/.ideavimrc

inoremap jj <Esc>

Now reload ~/.ideavimrc

:source ~/.ideavimrc

Check if your configurations work

:imap

You should see

i jj * <Esc>

If the configuration doesn't load next time you open your IDE, check how home works. You can read more about this in https://github.com/vlasovskikh/ideavim-vimscript/blob/master/help/txt/map.txt

like image 22
sudo bangbang Avatar answered Oct 24 '22 08:10

sudo bangbang