-
Notifications
You must be signed in to change notification settings - Fork 6
/
.tmux.conf
170 lines (135 loc) · 4.98 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
170
# ^s, not ^d
unbind C-b
set -g prefix C-s
# Shorten input delay (tmux normally adds a short delay on inputs)
set -sg escape-time 0
# send commands to nested session with ^s s
bind-key s send-prefix
# reload this on 'r'
bind r source-file ~/.tmux.conf
# terminal
set -g default-terminal screen-256color
set -g history-limit 50000
# bells and monitoring
set -g visual-silence on
set -g visual-bell on
set -g bell-action any
# statusbar
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/.tmux-powerline/status-left.sh)"
set-option -g status-right "#(~/.tmux-powerline/status-right.sh)"
set-option -g status-bg black #base02
set-option -g status-fg white #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg brightblue #base0
set-window-option -g window-status-bg default
# active window title colors
set-window-option -g window-status-current-fg white #orange
set-window-option -g window-status-current-bg default
# pane border
set-option -g pane-border-fg black #base02
set-option -g pane-active-border-fg white #base01
# message text
set-option -g message-bg black #base02
set-option -g message-fg brightred #orange
# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
# clock
set-window-option -g clock-mode-colour green #green
# fix resizing
setw -g aggressive-resize on
# vim resizes
bind - resize-pane -D 1
bind + resize-pane -U 1
bind < resize-pane -L 1
bind > resize-pane -R 1
# split or new window path perserve
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# and faster resizes
bind J resize-pane -D 5
bind K resize-pane -U 5
bind H resize-pane -L 5
bind L resize-pane -R 5
# vim copying
setw -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# Similar to 'C-w j' to navigate windows in Vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# Enable mouse support
set-option -g mouse on
# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# If we want Vim to be told about focus: http://git.io/2UqSgQ
set -g focus-events on
# try to set wm window titles with xterm codes
set -g set-titles on
# colour support
set -g default-terminal "xterm"
# fix pbcopy/pbpaste
if 'command -v reattach-to-user-namespace >/dev/null' \
'set -gq @osx-pasteboard true'
if 'tmux show -gv @osx-clipboard' \
'set -g default-command "reattach-to-user-namespace -l $SHELL"'
# Copy top of tmux paste buffer stack to OS clipboard.
# Alternatively, this will always immediately copy to system pasteboard:
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
if 'tmux show -gv @osx-clipboard' \
'bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# smart pane switching with awareness of vim splits
# see https://github.com/christoomey/vim-tmux-navigator
bind -n C-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-h" "select-pane -L"
bind -n C-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-j" "select-pane -D"
bind -n C-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-k" "select-pane -U"
bind -n C-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-l" "select-pane -R"
bind -n "C-\\" if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-\\" "select-pane -l"
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-open \
tmux-plugins/tmux-logging \
tmux-plugins/tmux-urlview \
tmux-plugins/tmux-fpp \
'
# Other examples:
# github_username/plugin_name \
# [email protected]/user/plugin \
# [email protected]/user/plugin \
# resurrect
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
# continuum
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
bind e setw synchronize-panes on
bind E setw synchronize-panes off