1

I mapped org-capture with C-c c like this:

(global-set-key (kbd "C-c c") #'org-capture)

Amongst my org-capture-template, two have been set like this:

 ("i" "Inbox"
       entry (file+datetree ,(concat captures-path "inbox.org"))
       "* INBOX %?")
  
 ("j" "Journal Entry for tmp"
       entry (file+datetree ,(concat captures-path "jtmp.org"))
       "* %?" :empty-lines 1)

Since I use a lot these two, I would like to remap them respectively with C-i and C-j (Which are duplicates of TAB and RET). All my attempts failed...

crocefisso
  • 1,141
  • 7
  • 15

1 Answers1

1

There are two things going on here:

  1. How to open a particular template from lisp
  2. How to bind a function to C-i.

For the first, note that org-capture takes an optional argument to set the template.

For the second, you need to override the translation to TAB: see this question for that.

Putting this together gives:

(define-key input-decode-map [?\C-i] [C-i])
(global-set-key (kbd "<C-i>") 
                (lambda () "Open inbox capture window"
                    (interactive)
                    (org-capture nil "i")))
Fran Burstall
  • 3,665
  • 10
  • 18