aboutsummaryrefslogtreecommitdiff
path: root/.tigrc
blob: 5353b47695541d047b8df885b5f42d266165aa03 (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
set diff-options = --diff-merges=first-parent
set wrap-lines = true
set tab-size = 4

# Navigation
bind generic g move-first-line
bind generic G move-last-line
bind main G move-last-line

# Search for diff (c)hunk and diff header
bind stage 2 :?^@@
bind diff 2 :?^@@
bind stage 3 :/^diff --(git|cc)
bind diff 3 :/^diff --(git|cc)

# Changes
bind generic + ?git commit --amend

# Branches
bind refs 3 ?git rebase -i %(branch)
bind refs M ?git merge %(branch)

# Grep view
bind generic S view-grep

# Use git difftool to view the diff
bind generic D !git difftool --no-prompt --trust-exit-code %(commit)^-
bind diff D !git difftool --no-prompt --trust-exit-code %(commit)^- -- %(file)
bind stage D !git difftool --no-prompt --trust-exit-code HEAD -- %(file)
bind stage D !sh -c "git difftool --no-prompt --trust-exit-code `expr '%(status)' : 'Staged changes' >/dev/null && echo --staged` -- '%(file)'"

# Misc
bind generic T !git notes edit %(commit)  
## Copy current commit ID to the clipboard
bind generic 9 @sh -c "echo -n %(commit) | xclip -selection c"