[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Binding literal tab to C-Tab
From: |
Joost Kremers |
Subject: |
Re: Binding literal tab to C-Tab |
Date: |
Fri, 06 Mar 2020 09:53:56 +0100 |
User-agent: |
mu4e 1.3.8; emacs 26.3 |
On Fri, Mar 06 2020, Josh wrote:
Hi all,
I have a need to insert literal tab characters into my org-mode
files
frequently. I would like to bind a key to insert literal tabs
(ASCII 9). I
thought Control-TAB would be a good option. So I inserted the
following lines
into my .emacs file. It works when in normal emacs, but not in
org-mode. Is
there a way to get this to work in org-mode? If this is a bad
key combination
for org-mode, I'm ok switching to another key combo.
Well, C-TAB is already bound in Org (to
`org-force-cycle-archived`), but if you have no use for that
command, you can of course rebind it. Since `global-set-key`
creates global bindings, which are shadowed by local bindings,
your binding has no effect in Org buffers. You need to bind C-TAB
in `org-mode-map`:
(define-key org-mode-map (kbd "C-<tab>") #'my-insert-tab-char)
HTH
--
Joost Kremers
Life has its moments