blob: bc2c00dde27aaba45e2e278ec85d28480633fd4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
# ref:
# https://qiita.com/sfus/items/063797a1dd8fdc7d032f
# https://github.com/jonas/tig/wiki/Bindings
# geineric
bind generic g none
bind generic gg move-first-line
bind generic G move-last-line
bind generic x :toggle id
bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c"
bind generic E view-grep
bind generic w :toggle ignore-case
bind generic 3 >sh -c "vim ~/.tigrc"
bind generic 4 :source ~/.tigrc
bind generic L >sh -c "git reflog --pretty=raw | tig --pretty=raw"
bind generic ; ?git reset --hard HEAD@{"%(prompt Enter HEAD@{} number: )"}
set ignore-case = true
set line-graphics = utf-8
set refresh-mode = after-command
set diff-show-signs = false
set diff_column_highlight = ALL
# 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 <Ctrl-r> !?git rebase -i %(commit)
bind main ! ?git revert %(commit)
bind main Tn @git tag "%(prompt Enter tag name: )" %(commit)
bind main TN !git tag "%(prompt Enter tag name: )" %(commit) -a
bind main Ts >tig show %(tag)
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: )"
bind main S !git format-patch -1 %(commit)
bind main . >sh -c "git diff %(commit) | tig"
bind main > >sh -c "git diff %(commit) --no-prefix -U1000 | tig"
# 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 push -m "%(prompt Enter stash name: )"
bind status gs !git stashstaged
bind status p !git checkout --patch -- %(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)
bind status <F4> !sh -c "git difftool -y \"$(git rev-parse --show-toplevel)/%(file)\""
bind status Tu @git update-index --assume-unchanged %(file)
# stash view
bind stash a ?git stash apply %(stash)
bind stash n @sh -c "git stash drop %(stash) | \
awk '{print $3}' | \
tr -d '()' | \
xargs git stash store -m '%(prompt Enter stash name: )'"
# stage view
bind stage n :/^@@
bind stage p :?^@@
bind stage <Esc>n :/^diff --(git|cc)
bind stage <Esc>p :?^diff --(git|cc)
# 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)
bind refs . >sh -c "git diff %(branch) | tig"
bind refs > >sh -c "git diff %(branch) --prefix -U1000 | tig"
# log view
bind log n :/^commit
bind log p :?^commit
# diff view
bind diff n :/^@@
bind diff p :?^@@
bind diff <Esc>n :/^diff --(git|cc)
bind diff <Esc>p :?^diff --(git|cc)
# color
color diff-header black yellow
color diff-chunk white magenta
|