BackToPlebbit69 · 2022-10-10 23:28
Hey there,
Is there a way to allow a user to fill out an Org Capture template without having to fill out each section via the minibuffer?
I ask because my keyboard kind of sucks and eats inputs sometimes, so the workflow gets jenk a bit. I would rather have some kind of checklist or small buffer that goes through each prompt than getting prompted by the mini buffer each time.
Please let me know if this could be fixed by a package instead as well, thanks!
itistheblurstoftimes · 2022-10-11 01:25
I agree, and recently wondered about using yasnippet to create org capture templates but after looking how much is involved in writing a yasnippet template, I politely declined. Hopefully there is something else out there.
globalcandyamnesia · 2022-10-11 01:36
How about using multiple `%?` in your capture template and then replacing them one at a time with the TAB key:
(defun my/next-prompt ()
(interactive)
(when (search-forward "%?" (point-max) t)
(replace-match "")))
(define-key org-capture-mode-map (kbd "<tab>") #'my/next-prompt)
BackToPlebbit69 · 2022-10-11 16:10
So would this appear in the actual Org file's buffer though? How does this work?
​
Can you give me the play by play on this? Asking this because as cool as this function looks, I'm wondering if it's still the workflow I want. Thank you for this by the way.
globalcandyamnesia · 2022-10-11 18:06
Sure, given a template like "* TODO %?\n- %?\n- %?\n- %?"
The capture buffer will look like this:
* TODO |
- %?
- %?
- %?
Where "|" is the cursor. Once you've filled out the heading title, press TAB and the capture buffer will look like this:
* TODO My Task
- |
- %?
- %?
Another TAB will move you to the next item and so on.
vaxdar · 2022-10-11 19:48
You can always test it out and see for yourself.
yantar92 · 2022-10-12 10:18
It is not that hard. Just use https://github.com/ag91/ya-org-capture. Example templates can be found in https://github.com/yantar92/emacs-config/blob/master/config.org#todo-item
BackToPlebbit69 · 2022-10-12 14:13
Oomph, this sounds awesome. Thank you for this!
You should totally make this into a package for Org Capture Templates on MELPA --> Thank me later :)
6 liner gamechanger plugin right there.
globalcandyamnesia · 2022-10-12 14:31
You should do it yourself, just add "globalcandyamnesia \<reddit.com/u/globalcandyamnesia\>" as an author.
BackToPlebbit69 · 2022-10-12 17:35
Nah, no thanks lol. Just a suggestion. I only mention this because I've tried to even upload a theme to MELPA, and the process is annoyingly difficult, so I'm good lol.