diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-29 11:39:43 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-29 11:39:43 +0530 |
| commit | 406432cd53c168390221ae37a41724eda5b867c9 (patch) | |
| tree | 86cc93cac5aafc87f5215c7ff3718362f3a26bc8 /autoload | |
| parent | 74d4dd79e50d816f87d4f7127b978d5f1467e1e6 (diff) | |
| download | kakoune-config-406432cd53c168390221ae37a41724eda5b867c9.tar.gz kakoune-config-406432cd53c168390221ae37a41724eda5b867c9.zip | |
Change singleton terminal escaping + ts face changes
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/git.kak | 26 | ||||
| -rw-r--r-- | autoload/repl.kak | 1 | ||||
| -rw-r--r-- | autoload/window.kak | 8 |
3 files changed, 8 insertions, 27 deletions
diff --git a/autoload/git.kak b/autoload/git.kak index 2cc3228..76485ab 100644 --- a/autoload/git.kak +++ b/autoload/git.kak @@ -9,8 +9,6 @@ declare-user-mode git-r map global user g ': enter-user-mode git<ret>' -docstring 'Git mode' map global git s ': gitui<ret>' -docstring 'Git tui' map global git A ': git add %val{buffile}<ret>' -docstring 'Add file' -map global git c ': git add commit<ret>' -docstring 'Commit' -map global git C ': git add commit --amend<ret>' -docstring 'Amend commit' map global git m ': git-line-blame<ret>' -docstring 'Blame selection lines' map global git r ': enter-user-mode git-r<ret>' -docstring 'Git re(base/set) mode' @@ -31,26 +29,6 @@ define-command git-toggle-diff %{ } define-command git-line-blame %{ - evaluate-commands %sh{ - file="${kak_buffile}" - line="$(echo "$kak_selection_desc" | sed -E 's/\.[0-9]+//g')" - echo "terminal sh -c \"git --no-pager log -u -L '$line:$file' --color=always | delta\"" - } + terminal-singleton git-blame sh -c \ + "git -p log -u -L '%sh{echo ""$kak_selection_desc"" | sed -E 's/\.[0-9]+//g'}:%val{buffile}' --color=always" } - -# TODO: Toggle this -# hook global -group git-diff-if-repo EnterDirectory .* %{ -# remove-hooks global git-diff -# try %{ -# evaluate-commands %sh{ -# if (git rev-parse --is-inside-work-tree >/dev/null 2>&1); then -# echo " -# hook global -group git-diff ModeChange .*:.*:normal %{ try %{git update-diff} } -# hook global -group git-diff WinCreate .* %{ try %{git update-diff} } -# hook global -group git-diff BufReload .* %{ try %{git update-diff} } -# " -# fi -# } -# } -# } - diff --git a/autoload/repl.kak b/autoload/repl.kak index 933664e..1e3d369 100644 --- a/autoload/repl.kak +++ b/autoload/repl.kak @@ -3,6 +3,7 @@ declare-option str xrepl_current_cmd; declare-option str xrepl_current_transform; declare-option bool xrepl_current_clear_screen false; +# TODO: Use register set to selection (paragraph) instead of selection # TODO: Add env # TODO: Migrate curly # TODO: Preserve original selection with send paragraph diff --git a/autoload/window.kak b/autoload/window.kak index a405924..f5f1d95 100644 --- a/autoload/window.kak +++ b/autoload/window.kak @@ -9,16 +9,18 @@ map global win z ': wq<ret>' define-command terminal-singleton -params 2.. -docstring 'terminal-singleton <name> <command> [args...]' %{ eval %sh{ - name="$1"; shift; + name="$1"; shift 1; open-term-win() { printf "terminal -n '$name' env" printf " 'KAKOUNE_SESSION=$kak_session' 'KAKOUNE_CLIENT=$kak_client'" - printf " %q" "$@" + for arg in "$@"; do + printf ' "%s"' "$(echo "$arg" | sed 's/["]/\\"/g')" + done } focus-term-win() { tmux select-window -t "$name" >/dev/null 2>&1 } - focus-term-win || open-term-win "$@"; + (focus-term-win || open-term-win "$@") } } |
