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

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

问题描述

我想在 EMACS 中使用 Ctrl + Tab 供我自己使用,但 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.

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

In my .emacs file I use:

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

它适用于除组织模式外的任何地方

and it works everywhere except in org-mode

推荐答案

您描述的键绑定在 org.el 中定义如下:

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

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

这意味着它仅在 org-mode-map(org-mode 的本地键盘映射之一)中有效.下面的代码添加了一个在 org-mode 启动时运行的 hook.它只是从 org-mode-map 中删除该键绑定.

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)))

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

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

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

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