覆盖EMACS org.mode中的Ctrl-TAB [英] Override Ctrl-TAB in EMACS org.mode

查看:115
本文介绍了覆盖EMACS org.mode中的Ctrl-TAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在EMACS中使用我自己使用的 Ctrl + 选项卡,但Emacs org模式已经有了这个约束。如何使用我自己的绑定而不是组织模式绑定。



在我的 .emacs 文件中,我使用:

 (global-set-key(kbd< C-tab>)'switch-view)

,除了在组织模式下,它可以运行。

解决方案

描述在 org.el 中定义,如下所示:

 (org-defkey org-mode-map [(control tab)]'org-force-cycle-archived)

这意味着它仅在组织模式的本地键盘映射之一的 org-mode-map 中有效。以下代码添加了在组织模式启动时运行的挂钩。它只是从 org-mode-map 中删除​​该键绑定。

 (add-hook'org-mode-hook 
'(lambda()
(define-key org-mode-map [(control tab)] nil)))

将此代码添加到.emacs文件中,然后重新启动emacs。


I would like to use Ctrl + Tab in EMACS for my own use, but Emacs org mode already has this bound. How can I use my own binding instead of the org-mode binding.

In my .emacs file I use:

(global-set-key (kbd "<C-tab>") 'switch-view )

and it works everywhere except in org-mode

解决方案

The key binding you describe is defined in org.el like this:

(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)

This means that it is only valid in org-mode-map, one of org-mode's local keymaps. The following code adds a hook that is run when org-mode starts. It simply removes that key binding from org-mode-map.

(add-hook 'org-mode-hook
          '(lambda ()
             (define-key org-mode-map [(control tab)] nil)))

Add this code to your .emacs file and then restart emacs.

这篇关于覆盖EMACS org.mode中的Ctrl-TAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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