Emacs密钥绑定优先级 [英] Emacs Key Binding Precedence

查看:111
本文介绍了Emacs密钥绑定优先级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对于默认行为autocomplete覆盖了yasnippets所使用的键绑定感到沮丧.

I'm frustrated with the default behavior of autocomplete overriding key bindings used by yasnippets.

有没有一种设置优先级的方法,以便制表符在尝试自动完成单词之前尝试扩展代码段?

Is there a way to set a precedence so that tab will try to expand a snippet before trying to autocomplete the word?

快速披露:我正在使用邪恶模式.

Quick disclosure: I'm using evil-mode.

推荐答案

如果它们都是次要模式,则优先级由minor-mode-map-alist中的元素顺序确定,除非明确操作,否则仅由顺序确定在其中加载了库.

If they're both minor modes, then precedence is determined by the order of elements in minor-mode-map-alist which, unless explicitly manipulated, is simply determined by the order in which the libraries were loaded.

确保在之前 yasnippet加载autocomplete,并且yasnippet的次要模式映射将具有优先级.

Ensure that autocomplete is loaded before yasnippet, and yasnippet's minor mode map would have precedence.

您也可以在加载autocomplete之后使用eval-after-load调整minor-mode-map-alist,检查yasnippet条目,并在必要时重新排列列表.

You could also use eval-after-load to adjust minor-mode-map-alist after loading autocomplete, to check for a yasnippet entry, and re-order the list if necessary.

(不过,autocomplete可以使用其他方法.例如,临时覆盖的键映射仍将优先于次要模式映射.)

(autocomplete may use other methods, though. A temporary overriding keymap would still have precedence over the minor mode maps, for instance.)

这篇关于Emacs密钥绑定优先级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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