简体   繁体   中英

Eclipse with Emacs keybindings: rebind Ctrl+J to end line and indent?

I need to use Eclipse to edit a language that doesn't have a good major mode in Emacs. I'm using what it advertises as "Emacs keybinding scheme", but it has several distinctions, some of them just happen too often and are really annoying when they happen.

One such keybinding is the Ctrl+J , or in a more Emacs-friendly format: Cj . This combination is typically bound to insertion of new line and indentation before the caret (unlike Enter or RET , which just inserts a line ending character).

So, I went to the Preferences panel, the keys settings, but I can't find anything that would simply insert a newline character. Ie I can unbind the Cj combination, but I don't seem to be able to assign it to do the insertion. Is there any way to do it? I only found "Insert Line (Above / Below) Current Line" command, but no analogue to self-insert-command etc.

This was one of the more important keybindings for me from emacs, so I really needed to get this to work.

Go to preferences->keys , choose emacs as the scheme, search for ctrl+j , and unbind it. It's set to incremental search by default, so I changed it to ctrl+s . Once it's unbound, it just works as it should. This has worked for me from eclipse 3.x to Juno .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM