From a0b9f6205f9123f6d350b7fc72f20f74c567d1ec Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 16 May 2025 15:42:01 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-16 15:42:01 --- .config/kak/kakrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 8007a81a..ee415dd9 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -124,17 +124,21 @@ map -docstring "commenct line" global normal ":comment-line" declare-user-mode git map -docstring "git" global user g ": enter-user-mode git" map -docstring "lazygit kak cwd" global git g ": terminal lazygit" -map -docstring "lazygit buffer directory" global git G %{ - evaluate-commands terminal "lazygit -w %sh{ - dirname "$kak_buffile" - }" + +define-command lazygit-buffer-dir %{ + evaluate-commands %sh{ + ROOT="$(env -C "$(dirname $kak_buffile)" git rev-parse --show-toplevel)" + printf "terminal lazygit -p %s" "$ROOT" + } } -def git_blame %{ +map -docstring "lazygit buffer directory" global git G ": lazygit-buffer-dir" + +define-command git-blame %{ info %sh{ git -C $(dirname $(realpath $kak_buffile)) blame -L $kak_cursor_line,$kak_cursor_line $(realpath $kak_buffile) } } -map -docstring "blame" global git b ": git_blame" +map -docstring "blame" global git b ": git-blame" map -docstring "format" global user F ": format"