Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Git integration via Tig

Johannes Altmanninger edited this pageAug 7, 2022 ·2 revisions

Tig is an ncurses-based interface for Git

Here's how to showgit blame information in Tig:

define-command tig -params .. -docstring"Run tig" %{terminal env"EDITOR=kak -c %val{session}" tig %arg{@}}define-command tig-blame-here -docstring"Run tig blame on the current line" %{tig -C%sh{git rev-parse --show-toplevel} blame -C"+%val{cursor_line}" --%sh{dir="$(git rev-parse --show-toplevel)"printf %s"${kak_buffile##$dir/}"}}

To show the history of the selected lines, try this command (inspired byhttps://github.com/junegunn/gv.vim):

define-command tig-blame-selection -docstring"Run tig -L on the selected lines" %{evaluate-commands -draft -save-regs d %{execute-keys <a-:>set-register d%sh{git rev-parse --show-toplevel}tig -C %reg{d}%sh{anchor=${kak_selection_desc%,*}anchor_line=${anchor%.*}cursor=${kak_selection_desc#*,}cursor_line=${cursor%.*}d=$kak_reg_dprintf %s"-L$anchor_line,$cursor_line:${kak_buffile##$d/}"}}}

For an alternative approach, seehttps://github.com/mawww/kakoune/wiki/Integrating-Other-CLI-apps#tig

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp