AutoYADM commit: 2025-05-17 15:39:24
This commit is contained in:
parent
59dd943ba8
commit
8535769aa8
1 changed files with 19 additions and 0 deletions
19
.config/fish/functions/kak-session.fish
Normal file
19
.config/fish/functions/kak-session.fish
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue