From fefa63d54ba174ab67ef6fc8e723be08a5b38e0e Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 21 May 2025 20:42:39 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-21 20:42:39 --- .config/fish/functions/kak-session.fish | 3 ++- .config/fish/functions/kl.fish | 4 ++++ .config/kak/autoload/title.kak | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .config/fish/functions/kl.fish diff --git a/.config/fish/functions/kak-session.fish b/.config/fish/functions/kak-session.fish index 188bdb6f..f869092f 100644 --- a/.config/fish/functions/kak-session.fish +++ b/.config/fish/functions/kak-session.fish @@ -91,7 +91,6 @@ function kak-session -w kak --description "kakoune where sessions are derived fr command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files end end - else if [ -n "$git_dir" ] # when in a git directory, share sessions # the shared session id is {repo}__{branch} where repo is the remote repo name @@ -119,6 +118,8 @@ function kak-session -w kak --description "kakoune where sessions are derived fr else command kak -s "$session_id" -e "cd %[$git_dir]" $flags $files end + else + command kak -c "$session_id" $flags $files end else command kak $flags $files diff --git a/.config/fish/functions/kl.fish b/.config/fish/functions/kl.fish new file mode 100644 index 00000000..8ce75d51 --- /dev/null +++ b/.config/fish/functions/kl.fish @@ -0,0 +1,4 @@ +function kl --wraps='kak -l' --description 'alias kl=kak -l' + kak -l $argv + +end diff --git a/.config/kak/autoload/title.kak b/.config/kak/autoload/title.kak index 0a9610d7..d116d0f6 100644 --- a/.config/kak/autoload/title.kak +++ b/.config/kak/autoload/title.kak @@ -12,7 +12,7 @@ define-command -hidden bar-buflist %{ cur=$(printf '%s %s' "$index" "$buf") fi list="$list $cur" - done <<<$(printf '%s\n' "$kak_buflist" | tr ' ' '\n') + done <<<$(printf '%s\n' "$kak_buflist" | perl -nE 'say for /(\*[^*]+\*|\S+)/g') title="$list - $kak_client@[$kak_session]" printf "set-option -add global ui_options %%{terminal_title=%s}" "$title" } @@ -21,3 +21,5 @@ define-command -hidden bar-buflist %{ hook global WinDisplay .* bar-buflist hook global FocusIn .* bar-buflist hook global FocusOut .* bar-buflist +hook global WinCreate .* bar-buflist +hook global BufClose .* bar-buflist