-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
executable file
·169 lines (133 loc) · 4.93 KB
/
tmux.conf
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
unbind C-b
set -g prefix C-a
# Misc options
set escape-time 0
set -g history-limit 1000000
setw -g aggressive-resize on
set -g default-terminal tmux
set -g renumber-windows on
# base index 1
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g automatic-rename off
# Mouse settings
set -g mouse off
# Allow copy-mode while holding ctrl
bind C-[ copy-mode
# Open new windows in current directory
bind c new-window -c "#{pane_current_path}"
# 24-bit true color support
set -ag terminal-overrides ",*:XT@:Tc"
set -ga terminal-overrides ",xterm-256color:Tc"
# Set window notifications
set-option -g bell-action other
set-option -g visual-bell on
#set -g visual-activity on
#setw -g monitor-activity on
# Reload config
bind C-r source-file ~/.tmux.conf
# Use vim-style keys
set -g mode-keys vi
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind S split-window -v -l 10 -c "#{pane_current_path}"
bind -Tcopy-mode-vi v send -X begin-selection
bind -Tcopy-mode-vi y send -X copy-pipe "yussh-copy"
bind -Tcopy-mode-vi 'C-v' send -X rectangle-toggle
# Search
bind / copy-mode \; send search-backward
# Rebind choose session
bind W choose-session
bind C-n next-window
bind C-p previous-window
bind a send-prefix # <C-a> a ( sends <C-A> )
bind C-a last-window # <C-a><C-a> ( goes to last window )
bind A switch-client -l # ( goes to last session )
# Maximize/minimize
bind C-f resize-pane -Z
# vim-tmux-navigation
#bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
#bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)n?vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# "Fix" clear screen
bind C-l send-keys 'C-l'
# reorder windows
bind -n S-Left swap-window -d -t -1
bind -n S-Right swap-window -d -t +1
# Colors!
# =====================
#set -g status-style fg=colour2
#set -ag status-style bg=colour234
#set -g pane-border-style fg=colour2
#set -g pane-active-border-style fg=colour13
#set -g display-panes-colour colour2
#colour0
#colour1
#colour2
#colour3
#colour4
#colour5
#colour6
#colour7
#colour8
#colour9
#colour10
#colour11
#colour12
#colour13
#colour14
#colour15
#colour16
# grep table binding
bind-key -Tgrep d list-keys
## Custom status bar
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 1
set -g window-status-format "#{s/0/⁰/;s/1/¹/;s/2/²/;s/3/³/;s/4/⁴/;s/5/⁵/;s/6/⁶/;s/7/⁷/;s/8/⁸/;s/9/⁹/:window_index} #W#{?window_zoomed_flag, 🔍,⁕}"
set -g window-status-current-format "#[bold,fg=colour13]#{s/0/⁰/;s/1/¹/;s/2/²/;s/3/³/;s/4/⁴/;s/5/⁵/;s/6/⁶/;s/7/⁷/;s/8/⁸/;s/9/⁹/:window_index} #W#{?window_zoomed_flag, 🔍,⁕}"
set -g window-status-separator " "
set -g @fingers-key 'C-f'
set -g @fingers-jump-key 'J'
set -g @fingers-skip-wizard 0
set -g @fingers-pattern-0 'git (cherry-pick|rebase|revert|merge) --(abort|continue|skip)'
set -g @fingers-pattern-1 'git push --set-upstream .*'
set -g @fingers-pattern-3 'foo'
set -g @fingers-keyboard-layout 'qwerty'
set -g @fingers-show-copied-notification '0'
set -g @fingers-hint-position 'left'
set -g @fingers-main-action "tee /home/morantron/.tmux-buffer"
set -g @fingers-ctrl-action ":paste:"
set -g @fingers-shift-action ":copy:"
set -g @fingers-alt-action "/tmp/open-in-vim.sh"
bind -n M-a last-window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 10
# plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'morantron/tmux-fingers'
set -g status-style fg=colour2
set -g status-left 'left'
set -g status-right 'right'
set -g status-left ' #[bold,fg=colour9]<3 #[nobold,fg=colour10]#S | '
set -g status-right ' | #[bold]%H:%M - %d %b %Y '
# dev version of tmux-fingers
run '~/hacking/tmux-inception/tmux-inception.tmux'
# plugins
run -b '~/.tmux/plugins/tpm/tpm'
# https://blog.testdouble.com/posts/2016-11-18-reconciling-tmux-and-ssh-agent-forwarding/
# Remove SSH_AUTH_SOCK to disable tmux automatically resetting the variable
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID \
SSH_CONNECTION WINDOWID XAUTHORITY"
# Use a symlink to look up SSH authentication
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock