aboutsummaryrefslogtreecommitdiff
path: root/autoload/git.kak
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-06-12 11:05:32 +0530
committerAkshay Nair <phenax5@gmail.com>2026-06-12 11:05:32 +0530
commitc68404f12210dfa4171a9b9ed1d19871352a4931 (patch)
treeab85998b3b77dd88f9fd116952099390b822f8e9 /autoload/git.kak
parent7a64e6d0e71f2c6728fe12fa01472e6b9a6bdfa9 (diff)
downloadkakoune-config-c68404f12210dfa4171a9b9ed1d19871352a4931.tar.gz
kakoune-config-c68404f12210dfa4171a9b9ed1d19871352a4931.zip
Add gitu blame key + update formatter
Diffstat (limited to 'autoload/git.kak')
-rw-r--r--autoload/git.kak5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload/git.kak b/autoload/git.kak
index 3c83a09..59ac173 100644
--- a/autoload/git.kak
+++ b/autoload/git.kak
@@ -15,6 +15,7 @@ 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 m ': git-line-blame<ret>' -docstring 'Blame selection lines'
+map global git M ': git-file-blame<ret>' -docstring 'Blame buffer file'
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'
@@ -42,6 +43,10 @@ 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-open-diff -params 0..1 %{
eval %sh{ git diff --name-only "${1:-HEAD}" | sed 's/^/edit /' }
}