Skip to content

Commit f959358

Browse files
author
github-actions
committed
[docgen] Update doc/orgmode.txt
1 parent 95d765b commit f959358

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

doc/orgmode.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ Variables:
568568
* `%x`: Insert content of the clipboard via the "+" register (see :help clipboard)
569569
* `%?`: Default cursor position when template is opened
570570
* `%^{PROMPT|DEFAULT|COMPLETION...}`: Prompt for input, if completion is provided an :h inputlist will be used
571-
* `%(EXP)`: Runs the given lua code and inserts the result
571+
* `%(EXP)`: Runs the given lua code and inserts the result. NOTE: this will internally pass the content to the lua `load()` function. So the body inside `%()` should be the body of a function that returns a string.
572572

573573
Example:
574574
>
@@ -607,6 +607,16 @@ Nested key example:
607607
}
608608
<
609609

610+
Lua expression example:
611+
>
612+
{ j = {
613+
description = 'Journal',
614+
template = '* %(return vim.fn.getreg "w")',
615+
-- get the content of register "w"
616+
target = '~/sync/org/journal.org'
617+
} }
618+
<
619+
610620
ORG_AGENDA_MIN_HEIGHT *orgmode-org_agenda_min_height*
611621

612622
type: `number`

0 commit comments

Comments
 (0)