aboutsummaryrefslogtreecommitdiffhomepage
path: root/tigrc
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-03-27 09:39:07 +0800
committertypebrook <typebrook@gmail.com>2019-03-27 09:39:07 +0800
commit875767033d54b4e52d4009843a0cf4f9e176bbae (patch)
tree3a573434120af08d6550029852cb1c616c84cf93 /tigrc
parentd0a5817fcede7663924bc775d8968a6db3ef8743 (diff)
update
Diffstat (limited to 'tigrc')
-rw-r--r--tigrc42
1 files changed, 41 insertions, 1 deletions
diff --git a/tigrc b/tigrc
index bc2c00d..953fa2c 100644
--- a/tigrc
+++ b/tigrc
@@ -2,21 +2,27 @@
2# https://qiita.com/sfus/items/063797a1dd8fdc7d032f 2# https://qiita.com/sfus/items/063797a1dd8fdc7d032f
3# https://github.com/jonas/tig/wiki/Bindings 3# https://github.com/jonas/tig/wiki/Bindings
4 4
5#====================
5# geineric 6# geineric
7#====================
6bind generic g none 8bind generic g none
7bind generic gg move-first-line 9bind generic gg move-first-line
8bind generic G move-last-line 10bind generic G move-last-line
9 11
12# toggle/copy commit id
10bind generic x :toggle id 13bind generic x :toggle id
11bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c" 14bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c"
12 15
13bind generic E view-grep 16bind generic gr view-grep
14 17
18# toggle case sensitive for search
15bind generic w :toggle ignore-case 19bind generic w :toggle ignore-case
16 20
21# edit tigrc
17bind generic 3 >sh -c "vim ~/.tigrc" 22bind generic 3 >sh -c "vim ~/.tigrc"
18bind generic 4 :source ~/.tigrc 23bind generic 4 :source ~/.tigrc
19 24
25# see reflog, reset refernece
20bind generic L >sh -c "git reflog --pretty=raw | tig --pretty=raw" 26bind generic L >sh -c "git reflog --pretty=raw | tig --pretty=raw"
21bind generic ; ?git reset --hard HEAD@{"%(prompt Enter HEAD@{} number: )"} 27bind generic ; ?git reset --hard HEAD@{"%(prompt Enter HEAD@{} number: )"}
22 28
@@ -24,10 +30,13 @@ set ignore-case = true
24set line-graphics = utf-8 30set line-graphics = utf-8
25set refresh-mode = after-command 31set refresh-mode = after-command
26 32
33# highlight diff without +/-
27set diff-show-signs = false 34set diff-show-signs = false
28set diff_column_highlight = ALL 35set diff_column_highlight = ALL
29 36
37#====================
30# main view 38# main view
39#====================
31set main-view = \ 40set main-view = \
32 date:default \ 41 date:default \
33 author:abbreviated \ 42 author:abbreviated \
@@ -36,6 +45,7 @@ set main-view = \
36 45
37bind main ` :toggle commit-title-graph 46bind main ` :toggle commit-title-graph
38 47
48# branch
39bind main b none 49bind main b none
40bind main bn @git branch "%(prompt Enter branch name: )" %(commit) 50bind main bn @git branch "%(prompt Enter branch name: )" %(commit)
41bind main bd @git branch -d "%(prompt Delete branch: )" 51bind main bd @git branch -d "%(prompt Delete branch: )"
@@ -47,16 +57,21 @@ bind main c @sh -c "git branch --points-at=%(commit) | \
47 head -1 | \ 57 head -1 | \
48 xargs git checkout" 58 xargs git checkout"
49 59
60# merge
50bind main m ?git merge %(commit) 61bind main m ?git merge %(commit)
51bind main M ?git merge %(branch) --no-ff 62bind main M ?git merge %(branch) --no-ff
63
64# push
52bind main p ?git push 65bind main p ?git push
53bind main P ?git push %(remote) %(branch):%(branch) 66bind main P ?git push %(remote) %(branch):%(branch)
54 67
68# reset/rebase/revert
55bind main u ?git reset %(commit) --soft 69bind main u ?git reset %(commit) --soft
56bind main gu ?git reset %(commit) --hard 70bind main gu ?git reset %(commit) --hard
57bind main <Ctrl-r> !?git rebase -i %(commit) 71bind main <Ctrl-r> !?git rebase -i %(commit)
58bind main ! ?git revert %(commit) 72bind main ! ?git revert %(commit)
59 73
74# tag
60bind main Tn @git tag "%(prompt Enter tag name: )" %(commit) 75bind main Tn @git tag "%(prompt Enter tag name: )" %(commit)
61bind main TN !git tag "%(prompt Enter tag name: )" %(commit) -a 76bind main TN !git tag "%(prompt Enter tag name: )" %(commit) -a
62bind main Ts >tig show %(tag) 77bind main Ts >tig show %(tag)
@@ -64,18 +79,26 @@ bind main Td @git tag -d "%(prompt Delete tag: )"
64bind main Tp ?git push --tags 79bind main Tp ?git push --tags
65bind main gdt @git tag -d %(tag) 80bind main gdt @git tag -d %(tag)
66 81
82# android
67bind main B !sh scripts/bump_version.sh 83bind main B !sh scripts/bump_version.sh
68bind main V @git log -S "%(prompt Enter search word: )" 84bind main V @git log -S "%(prompt Enter search word: )"
69 85
86# make patches
70bind main S !git format-patch -1 %(commit) 87bind main S !git format-patch -1 %(commit)
88bind main <Ctrl-s> !git format-patch %(commit)
71 89
90# show diff based on revision
72bind main . >sh -c "git diff %(commit) | tig" 91bind main . >sh -c "git diff %(commit) | tig"
73bind main > >sh -c "git diff %(commit) --no-prefix -U1000 | tig" 92bind main > >sh -c "git diff %(commit) --no-prefix -U1000 | tig"
74 93
94#====================
75# blame view 95# blame view
96#====================
76set blame-view = author:abbreviated date:default id:yes,color line-number:yes text 97set blame-view = author:abbreviated date:default id:yes,color line-number:yes text
77 98
99#====================
78# status view 100# status view
101#====================
79bind status j :/^[MADRU?] 102bind status j :/^[MADRU?]
80bind status k :?^[MADRU?] 103bind status k :?^[MADRU?]
81 104
@@ -93,25 +116,36 @@ bind status D ?rm %(file)
93bind status <F4> !sh -c "git difftool -y \"$(git rev-parse --show-toplevel)/%(file)\"" 116bind status <F4> !sh -c "git difftool -y \"$(git rev-parse --show-toplevel)/%(file)\""
94bind status Tu @git update-index --assume-unchanged %(file) 117bind status Tu @git update-index --assume-unchanged %(file)
95 118
119# apply patch file
120bind status <Ctrl-o> ?git am %(file)
121
122#====================
96# stash view 123# stash view
124#====================
97bind stash a ?git stash apply %(stash) 125bind stash a ?git stash apply %(stash)
98bind stash n @sh -c "git stash drop %(stash) | \ 126bind stash n @sh -c "git stash drop %(stash) | \
99 awk '{print $3}' | \ 127 awk '{print $3}' | \
100 tr -d '()' | \ 128 tr -d '()' | \
101 xargs git stash store -m '%(prompt Enter stash name: )'" 129 xargs git stash store -m '%(prompt Enter stash name: )'"
102 130
131#====================
103# stage view 132# stage view
133#====================
104bind stage n :/^@@ 134bind stage n :/^@@
105bind stage p :?^@@ 135bind stage p :?^@@
106bind stage <Esc>n :/^diff --(git|cc) 136bind stage <Esc>n :/^diff --(git|cc)
107bind stage <Esc>p :?^diff --(git|cc) 137bind stage <Esc>p :?^diff --(git|cc)
108 138
139#====================
109# tree view 140# tree view
141#====================
110bind tree d ?rm %(file) 142bind tree d ?rm %(file)
111bind tree 3 !@sh -c "echo -n %(file) | xclip -selection c" 143bind tree 3 !@sh -c "echo -n %(file) | xclip -selection c"
112bind tree 9 !@sh -c "echo -n %(blob) | head -c7 | xclip -selection c" 144bind tree 9 !@sh -c "echo -n %(blob) | head -c7 | xclip -selection c"
113 145
146#====================
114# refs view 147# refs view
148#====================
115bind refs C none 149bind refs C none
116bind refs c @git checkout %(branch) 150bind refs c @git checkout %(branch)
117 151
@@ -121,16 +155,22 @@ bind refs bD ?git branch -D %(branch)
121bind refs . >sh -c "git diff %(branch) | tig" 155bind refs . >sh -c "git diff %(branch) | tig"
122bind refs > >sh -c "git diff %(branch) --prefix -U1000 | tig" 156bind refs > >sh -c "git diff %(branch) --prefix -U1000 | tig"
123 157
158#====================
124# log view 159# log view
160#====================
125bind log n :/^commit 161bind log n :/^commit
126bind log p :?^commit 162bind log p :?^commit
127 163
164#====================
128# diff view 165# diff view
166#====================
129bind diff n :/^@@ 167bind diff n :/^@@
130bind diff p :?^@@ 168bind diff p :?^@@
131bind diff <Esc>n :/^diff --(git|cc) 169bind diff <Esc>n :/^diff --(git|cc)
132bind diff <Esc>p :?^diff --(git|cc) 170bind diff <Esc>p :?^diff --(git|cc)
133 171
172#====================
134# color 173# color
174#====================
135color diff-header black yellow 175color diff-header black yellow
136color diff-chunk white magenta 176color diff-chunk white magenta