diff options
Diffstat (limited to 'tigrc')
| -rw-r--r-- | tigrc | 65 |
1 files changed, 26 insertions, 39 deletions
| @@ -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 |
| 9 | bind generic g none | 7 | bind generic g none |
| 10 | bind generic gp view-grep | 8 | bind generic gp view-grep |
| @@ -70,9 +68,8 @@ set ignore-case = true | |||
| 70 | set line-graphics = utf-8 | 68 | set line-graphics = utf-8 |
| 71 | set refresh-mode = auto | 69 | set refresh-mode = auto |
| 72 | 70 | ||
| 73 | #==================== | 71 | # }}} |
| 74 | # main view | 72 | # View: Main {{{ |
| 75 | #==================== | ||
| 76 | set main-view = \ | 73 | set 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 | #==================== | ||
| 219 | bind blame m >tig --follow -- %(file) | 215 | bind blame m >tig --follow -- %(file) |
| 220 | bind blame . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" | 216 | bind blame . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" |
| 221 | bind blame > >sh -c "git diff --patch-with-stat %(ref) --no-prefix -U1000i -- %(file) | tig" | 217 | bind blame > >sh -c "git diff --patch-with-stat %(ref) --no-prefix -U1000i -- %(file) | tig" |
| 222 | 218 | ||
| 223 | set blame-view = author:abbreviated date:relative id:yes,color line-number:yes text | 219 | set blame-view = author:abbreviated date:relative id:yes,color line-number:yes text |
| 224 | 220 | ||
| 225 | #==================== | 221 | # }}} |
| 226 | # blob view | 222 | # blob view {{{ |
| 227 | #==================== | ||
| 228 | bind blob m >tig --follow -- %(file) | 223 | bind blob m >tig --follow -- %(file) |
| 229 | 224 | ||
| 230 | #==================== | 225 | # }}} |
| 231 | # status view | 226 | # status view {{{ |
| 232 | #==================== | ||
| 233 | bind status j :/^[MCADRUT?] | 227 | bind status j :/^[MCADRUT?] |
| 234 | bind status k :?^[MCADRUT?] | 228 | bind 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 |
| 272 | bind status <C-O> ?git am %(file) | 266 | bind status <C-O> ?git am %(file) |
| 273 | 267 | ||
| 274 | #==================== | 268 | # }}} |
| 275 | # stash view | 269 | # stash view {{{ |
| 276 | #==================== | ||
| 277 | bind stash a ?git stash apply %(stash) | 270 | bind stash a ?git stash apply %(stash) |
| 278 | bind stash d ?>git stash drop %(stash) | 271 | bind stash d ?>git stash drop %(stash) |
| 279 | bind stash p ?>git stash pop %(stash) | 272 | bind 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 | #==================== | ||
| 291 | bind stage <C-J> :/^@@ | 283 | bind stage <C-J> :/^@@ |
| 292 | bind stage <C-K> :?^@@ | 284 | bind stage <C-K> :?^@@ |
| 293 | bind stage <Esc>j :/^diff --(git|cc) | 285 | bind stage <Esc>j :/^diff --(git|cc) |
| 294 | bind stage <Esc>k :?^diff --(git|cc) | 286 | bind stage <Esc>k :?^diff --(git|cc) |
| 295 | 287 | ||
| 296 | #==================== | 288 | # }}} |
| 297 | # tree view | 289 | # tree view {{{ |
| 298 | #==================== | ||
| 299 | set tree-view = author:abbreviated date:relative mode file-size:units id:no file-name | 290 | set tree-view = author:abbreviated date:relative mode file-size:units id:no file-name |
| 300 | 291 | ||
| 301 | bind tree l enter | 292 | bind 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 | ||
| 314 | bind tree . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" | 305 | bind tree . >sh -c "git diff --patch-with-stat %(ref) -- %(file) | tig" |
| 315 | 306 | ||
| 316 | #==================== | 307 | # }}} |
| 317 | # refs view | 308 | # refs view {{{ |
| 318 | #==================== | ||
| 319 | bind refs b none | 309 | bind refs b none |
| 320 | bind refs r none | 310 | bind refs r none |
| 321 | bind refs C none | 311 | bind refs C none |
| @@ -336,15 +326,13 @@ bind refs > >sh -c "git diff --patch-with-stat %(branch) --prefix -U1000 | tig" | |||
| 336 | bind refs r none | 326 | bind refs r none |
| 337 | bind refs rr !sh -c "git remote | xargs -I{} sh -c 'echo {} $(git ls-remote {} %(ref))' | grep -E ' ' | cut -d' ' -f1" | 327 | bind 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 | #==================== | ||
| 342 | bind log <C-J> :/^commit | 331 | bind log <C-J> :/^commit |
| 343 | bind log <C-K> :?^commit | 332 | bind log <C-K> :?^commit |
| 344 | 333 | ||
| 345 | #==================== | 334 | # }}} |
| 346 | # diff view | 335 | # diff view {{{ |
| 347 | #==================== | ||
| 348 | bind diff <C-J> :/^@@ | 336 | bind diff <C-J> :/^@@ |
| 349 | bind diff <C-K> :?^@@ | 337 | bind diff <C-K> :?^@@ |
| 350 | bind diff <Esc>j :/^diff --(git|cc) | 338 | bind diff <Esc>j :/^diff --(git|cc) |
| @@ -353,15 +341,14 @@ bind diff <Esc>k :?^diff --(git|cc) | |||
| 353 | bind diff m >tig -- %(file) | 341 | bind diff m >tig -- %(file) |
| 354 | bind diff u @git checkout %(commit)^ -- %(file) | 342 | bind 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 |
| 361 | bind help e >sh -c "$EDITOR ~/.tigrc" | 348 | bind help e >sh -c "$EDITOR ~/.tigrc" |
| 362 | 349 | ||
| 363 | #==================== | 350 | # }}} |
| 364 | # color | 351 | # color {{{ |
| 365 | #==================== | ||
| 366 | color diff-chunk white magenta | 352 | color diff-chunk white magenta |
| 367 | color cursor black green bold | 353 | color cursor black green bold |
| 354 | # }}} | ||