-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
executable file
·174 lines (130 loc) · 5.23 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
173
174
# set -g default-terminal "screen-256color"
# set-option -sa terminal-overrides ",xterm*:Tc"
set -sa terminal-overrides "xterm-256color"
# set -sa terminal-overrides "screen-256color"
# set font display
set-window-option -q -g utf8 on
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
set-option -g xterm-keys on
# action key
unbind C-b
#bind t send-key C-t
set-option -g prefix C-t
set-option -g repeat-time 0
# Reload settings
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Kill all panes except current one with e
bind -r e kill-pane -a
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
# bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
# bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
# bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
# bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
# tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
# if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
# if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
#
# bind-key -T copy-mode-vi 'C-h' select-pane -L
# bind-key -T copy-mode-vi 'C-j' select-pane -D
# bind-key -T copy-mode-vi 'C-k' select-pane -U
# bind-key -T copy-mode-vi 'C-l' select-pane -R
# bind-key -T copy-mode-vi 'C-\' select-pane -l
# vim-like pane switching
bind -n C-k select-pane -U
bind -n C-j select-pane -D
bind -n C-h select-pane -L
bind -n C-l select-pane -R
# Shift-Alt to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# Moving window
bind-key -n C-S-Left swap-window -t -1 \; previous-window
bind-key -n C-S-Right swap-window -t +1 \; next-window
# Resizing pane
bind -r K resize-pane -U 5
bind -r J resize-pane -D 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# Maximize pane
bind -r m resize-pane -Z
# Bind splits
unbind %
bind | split-window -h -c "#{pane_current_path}" # and open in current
unbind '"'
bind - split-window -v -c "#{pane_current_path}" # and open in current
#### basic settings
# setting mouse scroll option
set -g mouse on
# to enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
set-option -g status-justify "left"
# look'n feel
set-option -g status-fg cyan
set-option -g status-bg black
set -g pane-active-border-style fg=colour166,bg=default
set -g window-style fg=colour6,bg=colour232
set -g window-active-style fg=colour36,bg=default
set-option -g history-limit 64096
set-option -g focus-events on # allow autoread
set -sg escape-time 0 # fastest command sequence
#### COLOUR
# default statusbar colors
set-option -g status-style bg=colour235,fg=colour136,default
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=colour234,dim
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default,bright
# pane border
set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-style fg=colour136 #,bg=colour235
# message text
set-option -g message-style bg=colour235,fg=colour166
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
# default shell
set -g default-command /usr/bin/fish
set -g default-shell /usr/bin/fish
# clock
set-window-option -g clock-mode-colour colour64 #green
# 24 hour clock
setw -g clock-mode-style 24
# clear both screen and history
bind -n C-x send-keys C-l \; run 'tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# allow the title bar to adapt to whatever host you connect to
set -g set-titles on
set -g set-titles-string "#h ❐ #S ● #I #W"
# set -g set-titles-string "#T"
# Set tmux statusbar position
set -g status-position top
#### Key bindings
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # start selecting text in rectangle mode with "C-v"
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode after dragging with mouse
# import
if-shell "uname -s | grep -q Darwin" "source ~/.tmux.conf.osx"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
# Powerline
source ~/.tmux.powerline.conf
# Initialize TMUX plugin manager (keep this line at the very bottom of tmyx.conf)
run '~/.tmux/plugins/tpm/tpm'