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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.