dotfiles/.config/kak/autoload/util.kak

13 lines
379 B
Text

define-command \
-docstring %{
Insert the date, with the args passed as a string
to date -d.
} \
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 '!<ret>'
}
}