diff --git a/.config/kak/autoload/util.kak b/.config/kak/autoload/util.kak index db9a30c7..30daf9e2 100644 --- a/.config/kak/autoload/util.kak +++ b/.config/kak/autoload/util.kak @@ -1,11 +1,13 @@ define-command \ -docstring %{ Insert the date, with the args passed as a string - to date -d + to date -d. } \ -insert-date -params 1.. %{ - evaluate-commands -draft -save-regs '|' %{ - set-register | "date -d '%arg{@}' -f +%%Y-%%m-%%d" - execute-keys '|' +insert-date -params 0.. %{ + evaluate-commands -draft -save-regs '|"' %{ + set-register | "date -d '%arg{@}' '+%%Y-%%m-%%d' | tr -d '\n'" + echo -debug "Inserting date: %reg{pipe}" + # we delete the trailing newline + execute-keys '!' } }