Emacs Python 解释器调整
配置 emacs 时遇到小问题。我正在尝试重新分配 M-Tab 键绑定以完成任何代码,因为它已经绑定到 ubuntu unity“选项卡/页面查看器”。
(require 'anything)
(require 'anything-ipython)
(when (require 'anything-show-completion nil t)
(use-anything-show-completion 'anything-ipython-complete
'(length initial-pattern)))
这些是我必须重新绑定它的尝试。不是特别想要,但我知道它没有被其他任何东西占据。
;;; (define-key anything-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-map (kbd "<F9>") 'anything)
只是不太能完全正确。
Having minor issue configuring emacs. I am trying to re-assign the M-Tab key binding for anything code completion as its already bound to ubuntu unity "tab/page viewer".
(require 'anything)
(require 'anything-ipython)
(when (require 'anything-show-completion nil t)
(use-anything-show-completion 'anything-ipython-complete
'(length initial-pattern)))
These are the attempts I have had to rebind it. don't particularly want but I know its not taken by anything else.
;;; (define-key anything-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-mode-map (kbd "<F9>") 'anything)
;;; (define-key anything-show-completion-map (kbd "<F9>") 'anything)
Just can't quite get it right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您会发现您想要使用小写的“f9”:
(kbd "")
而不是(kbd "").
您可以使用 ChkF9 检查 Emacs 报告该键的内容,并逐字使用相同的字符串作为参数
(kbd)
。另请注意,您使用 ESC 代替 Meta —— Emacs 会翻译它。因此 ESCTAB 将执行与 M-TAB 相同的操作。对于 TAB,您还可以使用 Ci 生成该字符代码,因此 MCi 是另一个现有绑定。
我查找了您提到的文件,anything-ipython.el 似乎是唯一绑定 M-TAB 的文件,并且根据其安装说明,您应该已经拥有以下代码:
所以我'我猜这就是你想要改变的。
I think you'll find that you want to use lower-case "f9":
(kbd "<f9>")
instead of(kbd "<F9>")
.You can check with C-hkF9 to see what Emacs reports that key as being, and use that same string verbatim as the argument to
(kbd)
.Also note that you use ESC as a substitute for Meta -- Emacs will translate it. So ESCTAB will do the same as M-TAB. And in the case of TAB, you can also generate that character code with C-i, so M-C-i is another existing binding.
I looked up the files you mentioned, and anything-ipython.el seems to be the only one which binds M-TAB, and based on its installation instructions you should already have the following code:
So I'm guessing that's what you want to be changing.