Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override Ctrl-TAB in EMACS org.mode

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

like image 838
yazz.com Avatar asked Dec 02 '10 09:12

yazz.com


1 Answers

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.

like image 166
paprika Avatar answered Sep 27 '22 23:09

paprika