-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
172 lines (132 loc) · 4.48 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
171
172
#reset bindings and colors
source ~/.tmux.reset.conf
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'glentakahashi/tmux-colors-solarized'
# renumber windows sequentially after closing any of them
set -g renumber-windows on
#set to be xterm, not sure why. fixes issues with a lot of things
set -g default-terminal "screen-256color"
# Titles
set-option -g allow-rename off
set -g set-titles on
set -g set-titles-string "#T"
# set prefix key to ctrl-a
unbind C-b
set -g prefix C-a
# lower command delay
set -sg escape-time 0
# pass through ctrl-a if you press it twice
bind -n M-a send-prefix
# switch between last window
bind a last-window
# start first window and pane at 1, not zero
set -g base-index 1
set -g pane-base-index 1
# bind r to reloading the config file
bind r source-file ~/.tmux.conf \; display "Reloaded tmux config file."
# better mnemonics for splitting panes!
bind | split-window -h
bind - split-window -v
#longer choose-pane time
set -g display-panes-time 1500
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_zoomed='echo "#{window_zoomed_flag}" | grep 1'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-h if-shell "$is_vim || $is_zoomed" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim || $is_zoomed" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim || $is_zoomed" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim || $is_zoomed" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim || $is_zoomed" "send-keys C-\\" "select-pane -l"
# Nested tmux sessions
bind -n M-h send-keys C-h
bind -n M-j send-keys C-j
bind -n M-k send-keys C-k
bind -n M-l send-keys C-l
# vim / xmonad style bindings for window movement
bind -r h select-window -t :-
bind -r l select-window -t :+
bind v swap-pane -s '!' -t $TMUX_PANE
#unbind arrow keys
unbind Left
unbind Up
unbind Right
unbind Down
# shift-movement keys will resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# disable mouse support
set -g mouse off
# configure contents of status bar
#set -g status-utf8 on
#set -g status-left "\"#S\""
set -g status-left-length 40
set -g status-left ""
set -g status-right "#h #{battery_icon} #{battery_percentage} | %d %b %R"
#window status bar
setw -g window-status-format "#I:#W#F"
setw -g window-status-current-format "#I:#W#F"
#set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on
# navigate using vim-style keys
setw -g mode-keys vi
# copy/paste using vim-style keys
bind y copy-mode
unbind p
bind p paste-buffer
bind -T copy-mode-vi 'v' send-keys -X begin-selection
bind -T copy-mode-vi 'y' send-keys -X copy-selection
bind -T copy-mode-vi Escape send-keys -X copy-selection
#fucking hate escape doing stuff
unbind Escape
unbind t
bind t setw synchronize-panes
unbind m
bind m new-session
#c-a $ rename
#bind-key 0 run "tmux split-window -l 12 'bash -ci ftpane'"
unbind .
bind . command-prompt -p "move window to session: " "move-window -t %%:"
# can't bind to C-[ without overwriting escape lol
bind -n C-] resize-pane -Z
bind -n M-] send-keys C-]
#bind q to select pane
bind -n C-q display-panes
bind -n M-q send-keys C-q
#use meta 1-5 to select layout
bind -n M-1 select-layout tiled
bind -n M-2 select-layout even-horizontal
bind -n M-3 select-layout even-vertical
bind -n M-4 select-layout main-horizontal
bind -n M-5 select-layout main-vertical
# auto window rename
#setw -g automatic-rename off
#bind n to new-windows
bind n new-window
#TODO :swap windows
#move windows
bind-key -n C-S-Left swap-window -t -1 \; select-window -t -1
bind-key -n C-S-Right swap-window -t +1 \; select-window -t +1
#move panes between windows
bind-key @ command-prompt -p "move pane to:" "join-pane -t ':%%'"
#unlimited history
set -g history-limit 99999
bind k clear-history
#handle system specific overrides at the end
source ~/.tmux.system.conf
#local overrides
source ~/.tmux.local.conf
#tpm
run '~/.tmux/plugins/tpm/tpm'
#highlight the current pane cause i can never figure it out
set -g pane-border-style 'fg=green,bg=colour235'
set -g pane-active-border-style 'fg=green,bg=default'
set -g window-style 'fg=colour247,bg=colour235'
set -g window-active-style 'fg=terminal,bg=terminal'