aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--alias4
-rw-r--r--tigrc65
2 files changed, 27 insertions, 42 deletions
diff --git a/alias b/alias
index 7b93dd4..df0a35f 100644
--- a/alias
+++ b/alias
@@ -114,6 +114,7 @@ alias findn='find . -iname'
114alias ce='crontab -e' 114alias ce='crontab -e'
115alias cl='crontab -l' 115alias cl='crontab -l'
116alias df='df -h' 116alias df='df -h'
117bak() { cp $1 $1.bak; }
117 118
118# }}} 119# }}}
119# Clipboard{{{ 120# Clipboard{{{
@@ -521,9 +522,6 @@ mvt.decode() {
521 fi 522 fi
522 mvt_decode.py $tmp | tr \' \" | sed 's/True/true/g; s/False/false/g' 523 mvt_decode.py $tmp | tr \' \" | sed 's/True/true/g; s/False/false/g'
523} 524}
524bak() {
525 cp $1 $1.bak
526}
527wrap2geojson() { jq -s '{ type: "FeatureCollection", features: . }'; } 525wrap2geojson() { jq -s '{ type: "FeatureCollection", features: . }'; }
528alias cdtrash='cd ~/.local/share/Trash' 526alias cdtrash='cd ~/.local/share/Trash'
529trash() { mv $@ ~/.local/share/Trash; } 527trash() { mv $@ ~/.local/share/Trash; }
diff --git a/tigrc b/tigrc
index c7b6589..71f1685 100644
--- a/tigrc
+++ b/tigrc
@@ -2,9 +2,7 @@
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# Generic {{{
6# geineric
7#====================
8# vim-like g binding, 'gp' for git grep 6# vim-like g binding, 'gp' for git grep
9bind generic g none 7bind generic g none
10bind generic gp view-grep 8bind generic gp view-grep
@@ -70,9 +68,8 @@ set ignore-case = true
70set line-graphics = utf-8 68set line-graphics = utf-8
71set refresh-mode = auto 69set refresh-mode = auto
72 70
73#==================== 71# }}}
74# main view 72# View: Main {{{
75#====================
76set main-view = \ 73set main-view = \
77 date:relative \ 74 date:relative \
78 author:abbreviated \ 75 author:abbreviated \
@@ -213,23 +210,20 @@ bind main gc >sh -c 'cloc --git %(commit) | tig'
213#bind generic gnn !git notes edit %(commit) 210#bind generic gnn !git notes edit %(commit)
214#bind generic gnr !git notes remove %(commit) 211#bind generic gnr !git notes remove %(commit)
215 212
216#==================== 213# }}}
217# blame view 214# blame view {{{
218#====================
219bind blame m >tig --follow -- %(file) 215bind blame m >tig --follow -- %(file)
220bind blame . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" 216bind blame . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig"
221bind blame > >sh -c "git diff --patch-with-stat %(ref) --no-prefix -U1000i -- %(file) | tig" 217bind blame > >sh -c "git diff --patch-with-stat %(ref) --no-prefix -U1000i -- %(file) | tig"
222 218
223set blame-view = author:abbreviated date:relative id:yes,color line-number:yes text 219set blame-view = author:abbreviated date:relative id:yes,color line-number:yes text
224 220
225#==================== 221# }}}
226# blob view 222# blob view {{{
227#====================
228bind blob m >tig --follow -- %(file) 223bind blob m >tig --follow -- %(file)
229 224
230#==================== 225# }}}
231# status view 226# status view {{{
232#====================
233bind status j :/^[MCADRUT?] 227bind status j :/^[MCADRUT?]
234bind status k :?^[MCADRUT?] 228bind status k :?^[MCADRUT?]
235 229
@@ -271,9 +265,8 @@ bind status <F4> !sh -c "git difftool -y \"$(git rev-parse --show-toplevel)/%(fi
271# apply patch file 265# apply patch file
272bind status <C-O> ?git am %(file) 266bind status <C-O> ?git am %(file)
273 267
274#==================== 268# }}}
275# stash view 269# stash view {{{
276#====================
277bind stash a ?git stash apply %(stash) 270bind stash a ?git stash apply %(stash)
278bind stash d ?>git stash drop %(stash) 271bind stash d ?>git stash drop %(stash)
279bind stash p ?>git stash pop %(stash) 272bind stash p ?>git stash pop %(stash)
@@ -285,17 +278,15 @@ bind stash n @sh -c "git stash drop %(stash) | \
285 tr -d '()' | \ 278 tr -d '()' | \
286 xargs git stash store -m '%(prompt Enter stash name: )'" 279 xargs git stash store -m '%(prompt Enter stash name: )'"
287 280
288#==================== 281# }}}
289# stage view 282# stage view {{{
290#====================
291bind stage <C-J> :/^@@ 283bind stage <C-J> :/^@@
292bind stage <C-K> :?^@@ 284bind stage <C-K> :?^@@
293bind stage <Esc>j :/^diff --(git|cc) 285bind stage <Esc>j :/^diff --(git|cc)
294bind stage <Esc>k :?^diff --(git|cc) 286bind stage <Esc>k :?^diff --(git|cc)
295 287
296#==================== 288# }}}
297# tree view 289# tree view {{{
298#====================
299set tree-view = author:abbreviated date:relative mode file-size:units id:no file-name 290set tree-view = author:abbreviated date:relative mode file-size:units id:no file-name
300 291
301bind tree l enter 292bind tree l enter
@@ -313,9 +304,8 @@ bind tree cp +sh -c "git cat-file -p %(blob) >%(file) && echo File copied to %(f
313 304
314bind tree . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" 305bind tree . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig"
315 306
316#==================== 307# }}}
317# refs view 308# refs view {{{
318#====================
319bind refs b none 309bind refs b none
320bind refs r none 310bind refs r none
321bind refs C none 311bind refs C none
@@ -336,15 +326,13 @@ bind refs > >sh -c "git diff --patch-with-stat %(branch) --prefix -U1000 | tig"
336bind refs r none 326bind refs r none
337bind refs rr !sh -c "git remote | xargs -I{} sh -c 'echo {} $(git ls-remote {} %(ref))' | grep -E ' ' | cut -d' ' -f1" 327bind refs rr !sh -c "git remote | xargs -I{} sh -c 'echo {} $(git ls-remote {} %(ref))' | grep -E ' ' | cut -d' ' -f1"
338 328
339#==================== 329# }}}
340# log view 330# log view {{{
341#====================
342bind log <C-J> :/^commit 331bind log <C-J> :/^commit
343bind log <C-K> :?^commit 332bind log <C-K> :?^commit
344 333
345#==================== 334# }}}
346# diff view 335# diff view {{{
347#====================
348bind diff <C-J> :/^@@ 336bind diff <C-J> :/^@@
349bind diff <C-K> :?^@@ 337bind diff <C-K> :?^@@
350bind diff <Esc>j :/^diff --(git|cc) 338bind diff <Esc>j :/^diff --(git|cc)
@@ -353,15 +341,14 @@ bind diff <Esc>k :?^diff --(git|cc)
353bind diff m >tig -- %(file) 341bind diff m >tig -- %(file)
354bind diff u @git checkout %(commit)^ -- %(file) 342bind diff u @git checkout %(commit)^ -- %(file)
355 343
356#==================== 344# }}}
357# help view 345# help view {{{
358#====================
359 346
360# edit tigrc 347# edit tigrc
361bind help e >sh -c "$EDITOR ~/.tigrc" 348bind help e >sh -c "$EDITOR ~/.tigrc"
362 349
363#==================== 350# }}}
364# color 351# color {{{
365#====================
366color diff-chunk white magenta 352color diff-chunk white magenta
367color cursor black green bold 353color cursor black green bold
354# }}}