AutoYADM commit: 2025-05-17 15:39:24

This commit is contained in:
Daniel Fichtinger 2025-05-17 15:39:24 -04:00
parent 59dd943ba8
commit 8535769aa8

View file

@ -0,0 +1,19 @@
function kak-session
function _kak_connect_or_create
set -l session_name $argv[1]
set argv $argv[2..]
set -l socket_paths \
"$XDG_RUNTIME_DIR/kakoune/$session_name" \
"{TMPDIR}/kakoune-$USER/$session_name"
end
# we treat the first file as the target
set -l targ $argv[1]
set -l root ""
set -l gitdir (env -C (path dirname $targ) git rev-parse --show-toplevel)
set session_name (string replace -r '[^a-zA-A0-9_-]' '_' (path basename $gitdir))
# handle file:line syntax, TODO later
_kak_connect_or_create $session_name $argv
end