bugfix: use of funcref in settings

This commit is contained in:
2026-02-26 13:44:44 +01:00
parent d6bc3cbb04
commit 7a82fe32db
4 changed files with 20 additions and 16 deletions

View File

@@ -125,15 +125,22 @@ g:denote_fm_md_type string
let g:denote_fm_md_type = 'yaml'
<
*g:denote_identifier_fun*
g:denote_identifier_fun Funcref
*g:Denote_identifier_fun*
g:Denote_identifier_fun Funcref
Denote allows the use of custom identifiers. This variable, if set,
points to a function that generates identifiers for newly created
notes. The function is supposed to return a unique string. By default,
the identifiers are computed with
the variable set as
>
strftime('%Y%m%dT%H%M%S')
let g:Denote_identifier_fun = function('denote#meta#identifier_generate')
<
or with |rand()| if the function |strftime()| is unavailable.
which calls |strftime('%Y%m%dT%H%M%S')| if |strftime()| is available, and
|rand()| otherwise. Another reasonable setting would be to use some uuid
generator and to specify, e.g.,
>
let g:Denote_identifier_fun = { -> system('uuidgen')
\ ->substitute('[^[:xdigit:]]', '', 'g') }
<
vim:tw=78:sw=4:ts=8:noet:ft=help:norl: