diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-07-02 12:02:50 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-07-02 12:03:32 +0530 |
| commit | 10bd058d848464257eb00cbf419295d97baa42f6 (patch) | |
| tree | e45b0117f64c9c38dc8b1e1c9c9a911e57817adb /autoload | |
| parent | 13a2f89ecbda892aeaf5533a2779a96fec2968e2 (diff) | |
| download | kakoune-config-main.tar.gz kakoune-config-main.zip | |
Diffstat (limited to '')
| -rw-r--r-- | autoload/+init.kak | 6 | ||||
| -rw-r--r-- | autoload/git.kak | 26 |
2 files changed, 27 insertions, 5 deletions
diff --git a/autoload/+init.kak b/autoload/+init.kak index 0bf78d9..5cd4c15 100644 --- a/autoload/+init.kak +++ b/autoload/+init.kak @@ -20,7 +20,11 @@ set-option global tabstop 2 set-option -add global path "**" set-option global startup_info_version 20260521 set-option global scrolloff 10,3 -set-option -add global ui_options terminal_enable_mouse=false terminal_status_on_top=true +set-option -add global ui_options \ + terminal_assistant=clippy \ + terminal_status_on_top=true \ + terminal_synchronized=true \ + terminal_enable_mouse=false # Modeline set-option global modelinefmt \ diff --git a/autoload/git.kak b/autoload/git.kak index 1b58a6e..3e12f8c 100644 --- a/autoload/git.kak +++ b/autoload/git.kak @@ -20,6 +20,7 @@ map global git d ': enter-user-mode git-d<ret>' -docstring 'Diff mode' map global git-d d ': git-open-diff<ret>' -docstring 'Open staged files' map global git-d c ': git-open-commit<ret>' -docstring 'Open files changed in last commit' map global git-d x ': git-grep-conflict-markers<ret>' -docstring 'Find conflicts' +map global git-d b ': git-diff-base-branch<ret>' -docstring 'Show diff against base branch' define-command git-grep-conflict-markers %{ grep <<<< } # rebase @@ -49,9 +50,7 @@ define-command git-line-blame %{ "git -p log -u -L '%sh{echo ""$kak_selection_desc"" | sed -E 's/\.[0-9]+//g'}:%val{buffile}' --color=always | delta" } -define-command git-file-blame %{ - terminal-singleton git-blame gitu blame %val{buffile} -} +define-command git-file-blame %{ terminal-singleton git-blame gitu blame %val{buffile} } define-command git-open-diff -params 0..1 %{ eval %sh{ git diff --name-only "${1:-HEAD}" | sed 's/^/edit /' } @@ -59,15 +58,34 @@ define-command git-open-diff -params 0..1 %{ define-command git-open-commit -params 0..1 %{ eval %sh{ git show --name-only --pretty="" "$@" | sed 's/^/edit /' } } +define-command git-diff-base-branch -params 0..1 %{ + info %sh{ echo "origin/$("$kak_config/scripts/git.clj" base-branch)" } + terminal-singleton git-diff git diff %sh{ echo "origin/$("$kak_config/scripts/git.clj" base-branch)" } +} define-command git-link %{ eval %sh{ line_start=${kak_selection_desc%%.*} tmp=${kak_selection_desc#*,} - line_end=${tmp%%.*} + line_end=${tmp%%.*} link=$("$kak_config/scripts/git.clj" link "$kak_buffile" "$line_start" "$line_end") xdg-open "$link" || true >/dev/null echo "info '$link'" } } +# # enable flag-lines hl for git diff +# hook global WinCreate .* %{ +# add-highlighter window/git-diff flag-lines Default git_diff_flags +# } +# # trigger update diff if inside git dir +# hook global BufOpenFile .* %{ +# evaluate-commands -draft %sh{ +# cd $(dirname "$kak_buffile") +# if [ $(git rev-parse --git-dir 2>/dev/null) ]; then +# for hook in WinCreate BufReload BufWritePost; do +# printf "hook buffer -group git-update-diff $hook .* 'git update-diff'\n" +# done +# fi +# } +# } |
