避免重叠键绑定在emacs? [英] Avoiding overlapped keybindings in emacs?

查看:88
本文介绍了避免重叠键绑定在emacs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了一些搜索,找不到我要找的东西,所以我想我会问。这可能是由于没有使用正确的术语。



我是新来的emacs,使用vim八年左右,但我真的需要一个编辑器我可以转变为我的意志,所以我正在切换。现在在vim中有一个你可以定义的领导键,以避免与各种扩展的重叠绑定。在emacs中,应该只为用户留出和弦,但是各种模式不符合这一点。有没有办法在emacs我可以确保我的自定义绑定不重叠类似于vim领导键?我想要的原因是我想保持我的绑定的理解。

解决方案

手册详细说明:



Ch g (elisp)键绑定约定 RET



为最终用户预留的顺序是:



    $任何(未修改)大写或小写字母的b $ b
  • Cc < letter> [A-Za-z ]

  • 功能键 F5 F6 F7 ,< > F8 , F9 (再次没有修饰键)



我建议使用最简单的这些序列作为前缀绑定,因为您可以使用任何键来跟随它们,为您提供大量选项。



否则我建议,如果您不常使用 suspend-frame ,因为这样可以打开另一个方便的前缀,那么我喜欢取消绑定 Cz 。 p>

我们的,如果您为您的操作系统和键盘,您可能会获得比您可以找到的更方便的序列。这对许多人来说是一个非常合理的选择,在许多现代键盘上都有其他修饰键。



最后, key-chord 库是通过使用一对(未修改)键或快速连续键创建新的方便和非冲突的绑定的流行方式(或单键敲击两次)。这在我的经验中效果很好,虽然你显然必须非常小心,以避免可能自然发生的绑定序列。


I have done some searching around and can not quite find what I am looking for so I figured I would ask. This could be due to not using the right terms however.

I am new to emacs, having used vim for eight years or so, but I really need an editor I can morph to my will so I am switching. Now in vim there is a leader key you can define to avoid overlapping bindings with various extensions. In emacs there are supposed to be chords set aside for the user only but various modes do not adhere to this. Is there a way in emacs I can ensure my custom bindings do not overlap similar to the vim leader key? The reason I ask is I want to keep my bindings sane.

解决方案

The manual details the conventions:

C-hig (elisp) Key Binding Conventions RET

Sequences reserved for the end-user are:

  • C-c<letter> for any (un-modified) upper or lower case letter: [A-Za-z]
  • Function keys F5, F6, F7, F8, F9 (again, without modifier keys)

I recommend using the easiest of these sequences as prefix bindings, as you can then follow them with any key at all, giving you a large number of options.

Someone else's recommendation that I liked was to unbind C-z if you don't commonly use suspend-frame, as that opens up another convenient prefix.

Of course, if you set up Super and Hyper modifier keys for your OS & keyboard, you would likely gain more convenient sequences than you could find uses for. This is a very reasonable option for many people with the additional modifier keys found on many modern keyboards.

Finally, the key-chord library is quite a popular way of creating new convenient and non-conflicting bindings by using pairs of (un-modified) keys typed together or in quick succession (or a single key tapped twice). This works very well in my experience, although you obviously have to be very careful to avoid binding sequences which might occur naturally.

这篇关于避免重叠键绑定在emacs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆