简体   繁体   English

使用Emacs键绑定的Eclipse:将Ctrl + J重新绑定到结束行并缩进吗?

[英]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. 我需要使用Eclipse编辑在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. 我使用的是它宣传为“ Emacs密钥绑定方案”的东西,但是它有几个区别,其中一些只是发生得太频繁,并且在它们发生时确实很烦人。

One such keybinding is the Ctrl+J , or in a more Emacs-friendly format: Cj . 一种这样的键绑定是Ctrl + J ,或者更符合Emacs的格式: 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). 这种组合通常必须在插入符号前插入新行和缩进(不同于EnterRET ,后者只是插入行结束符)。

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. 即我可以取消绑定Cj组合,但是我似乎无法将其分配给插入。 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. 我只找到了“插入当前行(在上/下)当前行”命令,但没有类似self-insert-command

This was one of the more important keybindings for me from emacs, so I really needed to get this to work. 这是emacs中对我来说更重要的键绑定之一,因此我确实需要使它生效。

Go to preferences->keys , choose emacs as the scheme, search for ctrl+j , and unbind it. 转到preferences->keys ,选择emacs作为方案,搜索ctrl + j ,然后取消绑定。 It's set to incremental search by default, so I changed it to ctrl+s . 默认情况下将其设置为incremental search ,因此我将其更改为ctrl + s Once it's unbound, it just works as it should. 一旦解除绑定,它将按预期工作。 This has worked for me from eclipse 3.x to Juno . eclipse 3.xJuno这对我来说都是有效的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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