AutoYADM commit: 2025-05-21 14:57:18

This commit is contained in:
Daniel Fichtinger 2025-05-21 14:57:18 -04:00
parent 2fe337e881
commit b0590df0d9
3 changed files with 8 additions and 4 deletions

View file

@ -35,10 +35,13 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
return 1 return 1
end end
set kakroot (fdup .kakroot $files[1]) set kakroot (fdup '\.kakroot|\.kakrc.local|\.local.kakrc|kakrc' $files[1])
if test -n "$kakroot" if test -n "$kakroot"
set session_id (echo -n "$(path basename "$kakroot")" | tr --complement '[:alpha:]_-' '-') set session_id (echo -n "$(path basename "$kakroot")" | tr --complement '[:alpha:]_-' '-')
# special case; kakrc
if test "$kakroot" = ~/.config/kak
set session_id kakrc
end
# if there is no existing session # if there is no existing session
if not command kak -l | rg -xqF "$session_id" if not command kak -l | rg -xqF "$session_id"
set fifo_dir (mktemp -d --suffix=kak-init.XXXXXX) set fifo_dir (mktemp -d --suffix=kak-init.XXXXXX)

View file

@ -10,7 +10,7 @@ define-command ide %{
} }
# project-specific configuration # project-specific configuration
hook global BufCreate (.*/)?(\.kakrc\.local) %{ hook global BufCreate (.*/)?(\.kakrc\.local|\.kakrc\.local) %{
set-option buffer filetype kak set-option buffer filetype kak
} }

View file

@ -20,7 +20,7 @@ map -docstring "open a file with yazi (blocking)" global yazi f ": open-yazi-thi
define-command spawn-yazi %{ define-command spawn-yazi %{
terminal yazi terminal yazi
} }
map global -docstring "spawn yazi" global yazi <space> ': spawn-yazi<ret>' map -docstring "spawn yazi" global yazi <space> ': spawn-yazi<ret>'
define-command open-yazi-new-client %{ define-command open-yazi-new-client %{
evaluate-commands %sh{ evaluate-commands %sh{
@ -36,3 +36,4 @@ define-command open-yazi-new-client %{
fi fi
} }
} }
map -docstring "open with yazi in new client" global yazi n ': open-yazi-new-client<ret>'