# ref: # https://qiita.com/sfus/items/063797a1dd8fdc7d032f # https://github.com/jonas/tig/wiki/Bindings # geineric bind generic x :toggle id bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c" bind generic g none bind generic gg move-first-line bind generic G move-last-line bind generic gr view-grep bind generic w :toggle ignore-case set ignore-case = true set line-graphics = utf-8 set refresh-mode = after-command # main view set main-view = \ date:default \ author:abbreviated \ id \ commit-title:graph=v2,refs=true bind main ` :toggle commit-title-graph bind main b none bind main bn @git branch "%(prompt Enter branch name: )" %(commit) bind main bd @git branch -d "%(prompt Delete branch: )" bind main bD ?git branch -D "%(prompt Delete branch anyway: )" bind main bv +sh -c "git branch -vv | grep '*'" bind main c @sh -c "git branch --points-at=%(commit) | \ sed -n '/^*/ {n;p}' | \ (cat -; echo %(commit)) | \ head -1 | \ xargs git checkout" bind main m ?git merge %(commit) bind main M ?git merge %(branch) --no-ff bind main p ?git push bind main P ?git push %(remote) %(branch):%(branch) bind main u ?git reset %(commit) --soft bind main gu ?git reset %(commit) --hard bind main !?git rebase -i %(commit) bind main Tn @git tag "%(prompt Enter tag name: )" %(commit) bind main TN !git tag "%(prompt Enter tag name: )" %(commit) -a bind main Td @git tag -d "%(prompt Delete tag: )" bind main Tp ?git push --tags bind main gdt @git tag -d %(tag) bind main B !sh scripts/bump_version.sh bind main V @git log -S "%(prompt Enter search word: )" # blame view set blame-view = author:abbreviated date:default id:yes,color line-number:yes text # status view bind status j :/^[MADRU?] bind status k :?^[MADRU?] bind status s ?git stash bind status S @git stash save "%(prompt Enter stash name: )" bind status gs !git stash save -p "%(prompt Enter stash name: )" bind status p !git checkout --patch -- %(file) bind status Tu @git update-index --assume-unchanged %(file) bind status c @git commit -m "%(prompt Enter commit message: )" bind status C !git commit bind status a ?git commit --amend bind status D ?rm %(file) # stash view bind stash a ?git stash apply %(stash) # tree view bind tree d ?rm %(file) bind tree 3 !@sh -c "echo -n %(file) | xclip -selection c" bind tree 9 !@sh -c "echo -n %(blob) | head -c7 | xclip -selection c" # refs view bind refs C none bind refs c @git checkout %(branch) bind refs bd ?git branch -d %(branch) bind refs bD ?git branch -D %(branch) # color color diff-header black yellow color diff-chunk white magenta bind status !sh -c "git difftool -y \"$(git rev-parse --show-toplevel)/%(file)\""