AutoYADM commit: 2025-07-07 18:42:34

This commit is contained in:
Daniel Fichtinger 2025-07-07 18:42:34 -04:00
parent 6e35eb0210
commit fef01ae393
3 changed files with 22 additions and 4 deletions

View file

@ -56,5 +56,21 @@ define-command -docstring %{
}
}
define-command -docstring %{
mkdir [<args>]: create directory
If no arguments, parents of current file are ensured.
Else, all args passed to mkdir.
} mkdir -params 0.. %{
evaluate-commands %sh{
if [ "$#" -eq 0 ]; then
# ensure current file parent
mkdir -p "$(dirname -- "$kak_buffile")"
else
# pass to mkdir
mkdir $@
fi
}
}
alias global rm remove-file
complete-command remove-file file

View file

@ -9,10 +9,12 @@ provide-module url-open %∴
set-register b 'https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)'
try %{
execute-keys -draft '<a-a><a-w>s<c-r>b<ret>"ay'
nop %sh{
eval "$(printf "$kak_opt_url_open_cmd" "$kak_reg_a")"
evaluate-commands %sh{
# strip trailing punctuation
clean_url="$(echo "$kak_reg_a" | sed 's/[][(){}.,;!?]*$//')"
echo "info -title 'URL Opened' '$clean_url'"
eval "$(printf "$kak_opt_url_open_cmd" "$clean_url")" >/dev/null 2>&1
}
echo "Opened %reg{a}"
} catch %{
fail 'Cursor is not on a URL!'
}

View file

@ -275,4 +275,4 @@ map -docstring 'add selection' global normal Y <a-Z>a
# open URL
require-module url-open
map -docstring "Open URL" global user <a-ret> ':url-open<ret>'
map -docstring "Open URL" global goto u '<esc>: url-open<ret>'