I'm using org to store a list of links, I capture the links with org-capture and a custom template, but I want to write the new entries at top of the file. how I can do this?
1 Answer
From the Org-Mode Manual, you can add the following template element to your custom captures:
:prepend t
Normally new captured information will be appended at the target location (last child, last table line, last list item...). Setting this property will change that.
See the related post Using properties in org-mode capture templates, where for example you can achieve the desired effect by using:
("w" "Default template" entry (file+headline (concat (file-name-as-directory org-directory) "journal.org") "Notes")
"* TODO [#C] %^{Title} %?" :prepend t)
-
by the way,
t
is missing from the manual AFAICT, otherwise:prepend
alone won't work. This gave me headache couple of days ago. Apr 26, 2019 at 11:01 -
@doctorate, I know it is old, but I have just stumbled across this wondering the same thing. All I can guess is that
t
is the value of aUnit
type. in a functional language, all functions have to have an argument. If your function doesn't need an argument you just define it to receive aUnit
. I could be wrong, but that is what it seems to me. Aug 12, 2020 at 7:34
org-reverse-note-order
.:prepend t
is correct that it ensures new entries are added above older ones, that applies only within a date header. The date headers themselves are still added latest after previous. Andorg-reverse-note-order
doesn't change that either. Because the:prepend t
answer has been marked as accepted, I've asked a similar question to this but specifying more completely what is required. It's here.