AutoYADM commit: 2025-05-21 23:21:52
This commit is contained in:
parent
314cefd1ca
commit
ba437c354a
2 changed files with 22 additions and 2 deletions
|
@ -90,6 +90,8 @@ function kak-session -w kak --description "kakoune where sessions are derived fr
|
||||||
else
|
else
|
||||||
command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files
|
command kak -s "$session_id" -e "cd %[$kakroot]" $flags $files
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
command kak -c "$session_id" $flags $files
|
||||||
end
|
end
|
||||||
else if [ -n "$git_dir" ]
|
else if [ -n "$git_dir" ]
|
||||||
# when in a git directory, share sessions
|
# when in a git directory, share sessions
|
||||||
|
|
|
@ -14,10 +14,20 @@ declare-option -docstring %{
|
||||||
It receives two string arguments, where the first is the buffer index,
|
It receives two string arguments, where the first is the buffer index,
|
||||||
and the second is the buffer name.
|
and the second is the buffer name.
|
||||||
|
|
||||||
|
Default: '[%s %s]+'
|
||||||
|
} str bar_active_modified_fmt '[%s %s]+'
|
||||||
|
declare-option -docstring %{
|
||||||
|
Format string passed to printf for the bufferlist.
|
||||||
|
It should be set in the global scope.
|
||||||
|
|
||||||
|
It receives two string arguments, where the first is the buffer index,
|
||||||
|
and the second is the buffer name.
|
||||||
|
|
||||||
Default: '%s %s'
|
Default: '%s %s'
|
||||||
} str bar_inactive_fmt '%s %s'
|
} str bar_inactive_fmt '%s %s'
|
||||||
define-command -hidden bar-buflist %{
|
define-command -hidden bar-buflist %{
|
||||||
evaluate-commands %sh{
|
evaluate-commands %sh{
|
||||||
|
starttime=$(date +%s%3N)
|
||||||
list=''
|
list=''
|
||||||
while read buf; do
|
while read buf; do
|
||||||
if [ "$buf" = '*debug*' ]; then
|
if [ "$buf" = '*debug*' ]; then
|
||||||
|
@ -25,14 +35,20 @@ define-command -hidden bar-buflist %{
|
||||||
fi
|
fi
|
||||||
index=$(($index + 1))
|
index=$(($index + 1))
|
||||||
if [ "$buf" = "$kak_bufname" ]; then
|
if [ "$buf" = "$kak_bufname" ]; then
|
||||||
cur=$(printf "$kak_opt_bar_active_fmt" "$index" "$buf")
|
if [ "$kak_modified" = "true" ]; then
|
||||||
|
cur=$(printf "$kak_opt_bar_active_modified_fmt" "$index" "$buf")
|
||||||
|
else
|
||||||
|
cur=$(printf "$kak_opt_bar_active_fmt" "$index" "$buf")
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
cur=$(printf "$kak_opt_bar_inactive_fmt" "$index" "$buf")
|
cur=$(printf "$kak_opt_bar_inactive_fmt" "$index" "$buf")
|
||||||
fi
|
fi
|
||||||
list="$list $cur"
|
list="$list $cur"
|
||||||
done <<<$(printf '%s\n' "$kak_buflist" | perl -nE 'say for /(\*[^*]+\*|\S+)/g')
|
done <<<$(printf '%s\n' "$kak_buflist" | perl -nE 'say for /(\*[^*]+\*|\S+)/g')
|
||||||
title="$list - $kak_client@[$kak_session]"
|
title="$list - $kak_client@[$kak_session]"
|
||||||
|
endtime=$(date +%s%3N)
|
||||||
printf "set-option -add global ui_options %%{terminal_title=%s}" "$title"
|
printf "set-option -add global ui_options %%{terminal_title=%s}" "$title"
|
||||||
|
printf "info 'time elapsed: %s ms'" "$((end - start))"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,4 +56,6 @@ hook global WinDisplay .* bar-buflist
|
||||||
hook global FocusIn .* bar-buflist
|
hook global FocusIn .* bar-buflist
|
||||||
hook global FocusOut .* bar-buflist
|
hook global FocusOut .* bar-buflist
|
||||||
hook global WinCreate .* bar-buflist
|
hook global WinCreate .* bar-buflist
|
||||||
hook global BufClose .* bar-buflist
|
hook global NormalIdle .* bar-buflist
|
||||||
|
hook global BufWritePost .* bar-buflist
|
||||||
|
hook global ModeChange .* bar-buflist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue