-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tigrc
96 lines (75 loc) · 3.38 KB
/
.tigrc
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
#############################
# キーバインド
#############################
# shift+gで末尾
bind generic G move-last-line
# 空commit
bind generic L !git commit --allow-empty
# rebase -i を割り当て
bind main B !git rebase -i %(commit)
bind diff B !git rebase -i %(commit)
## 参考 "https://qiita.com/sfus/items/063797a1dd8fdc7d032f"
# P で remote への push
bind generic P ?git push -u %(remote) %(repo:head)
# F で fetch (default: :toggle file-name / :toggle commit-title-refs)
bind generic F ?git fetch %(remote)
bind main F ?git fetch %(remote)
# S で stash save
bind status S ?git stash save "%(prompt Enter stash comment: )"
# H で reset --hard
#bind main H ?git reset --hard %(commit)
#bind diff H ?git reset --hard %(commit)
#bind refs H ?git reset --hard %(branch)
# ^ で reset --soft
bind generic ^ ?git reset --soft HEAD^
# ` で commit ID をクリップボードにコピー (Mac用)
bind generic ` @bash -c "echo -n '%(commit)' | pbcopy"
# ` でファイルパスをクリップボードにコピー (Mac用)
bind stage ` @bash -c "echo -n '%(file)' | pbcopy"
bind status ` @bash -c "echo -n '%(file)' | pbcopy"
bind tree ` @bash -c "echo -n '%(file)' | pbcopy"
bind blob ` @bash -c "echo -n '%(file)' | pbcopy"
# . で HEAD との diff
bind main . !sh -c "git diff %(commit) | tig"
bind diff . !sh -c "git diff %(commit) | tig"
bind refs . !sh -c "git diff %(branch) | tig"
#############################
# 画面系
#############################
# デフォルト値
# set vertical-split = auto
# 横分割に強制する
set vertical-split = no
# main view の左端にコミットIDを表示する
set main-view = id date author:email-user commit-title:graph=yes,refs=yes
# 行数表示をON
set blob-view-line-number = yes
set blame-view-line-number = yes
# utf-8 文字で画面描画する (~でトグル)
set line-graphics = utf-8
# タブサイズ
set tab-size = 4
# 差分表示に diff-highlight を使う (要 tig 2.2.1 以降. diff-highlight が $PATH にあること)
set diff-highlight = true
# diff-view で境界が見やすくなるように変更
color diff-header default magenta
color diff-chunk black white
# リフレッシュするタイミング
set refresh-mode = auto
## 外部コマンド系
# ; で GitHub の該当コミットを開く ※要 hub インストール
bind main ; @hub browse -- commit/%(commit)
bind blame ; @hub browse -- commit/%(commit)
bind diff ; @hub browse -- commit/%(commit)
# ; で GitHub の該当ページを開く
bind tree ; @hub browse -- blob/%(branch)/%(file)
bind blob ; @hub browse -- blob/%(branch)/%(file)
bind grep ; @hub browse -- blob/%(branch)/%(file)
# Alt-; で GitHub の指定ブランチの該当ページを開く
bind tree <Esc>; @hub browse -- blob/"%(prompt Enter branch name: )"/%(file)
bind blob <Esc>; @hub browse -- blob/"%(prompt Enter branch name: )"/%(file)
bind grep <Esc>; @hub browse -- blob/"%(prompt Enter branch name: )"/%(file)
# w で GitHub の該当ブランチの Pull Request 作成ページを開く ※要 hub インストール
bind main w @hub browse -- compare/%(branch)?expand=1
bind diff w @hub browse -- compare/%(branch)?expand=1
bind refs w @hub browse -- compare/%(branch)?expand=1