Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a vim plugin for eclipse that let me remap jj to Esc?

Tags:

vim

eclipse

I am looking for an eclipse plugin that gives me basic vim commands.

I don't expect to much but I'm so used to 'jj' for escape that this feature is essential for me. 'jj' should work like in vim: Leave insert mode but don't insert any characters.

I'm considering

  • viplugin
  • vrapper
  • viable
  • vimplugin
  • eclim

but didn't find much information if it is possible to remap anything to ESC.

With viplugin it seems possible to do that, but when remapping 'jj' it still inserts 'jj'. Eclim should support it, but it's probably to heavy.

like image 304
bbuser Avatar asked Feb 15 '12 08:02

bbuser


2 Answers

You can customize vrapper's behaviour with a vimrc-like file: ~/.vrapperrc. It works like ~/.vimrc syntax-wise but you are quite limited in what you can put there.

inoremap jj <ESC>

does exactly what you want, though, just like in Vim.

like image 195
romainl Avatar answered Oct 22 '22 00:10

romainl


What worked for me:

  1. Make sure your .vrapperrc is in what Eclipse has as your user director. A quick google gave this:

"If you go to Help > About > Installation Details > Configuration tab, can you check if the directory listed next to user.home is the one your .vrapperrc is in?"

  1. Add this line to the .vrapperrc:

imap jj <ESC>

'inoremap' didn't seem to work for me, but that might have been because of some other issue.

  1. Restart Eclipse and profit.
like image 32
Drew Bell Avatar answered Oct 22 '22 00:10

Drew Bell