-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
161 lines (122 loc) · 4.39 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
#colors
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# Don't rename windows
set-option -g allow-rename off
set-option -g default-shell $SHELL
# Disable bell
set -g bell-action none
set -g visual-bell off
# Enable mouse mode
set -g mouse on
set-option -gw xterm-keys on
# Enable vi mode
set-window-option -g mode-keys vi
# Enter search with prefix-/
bind-key / copy-mode \; send-key ?
# Use xclip clipboard for copy/paste
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
# Make tmux not wait for a keybinding, insert -> normal
set -sg escape-time 0
# Easy Config Reloads
bind r source-file ~/.tmux.conf
# Split panes using | and -
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Create new window in current path
bind c new-window -c "#{pane_current_path}"
# Prefix
unbind %
unbind b
# Selecting panes
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
# Resizing panes
bind -r H resize-pane -L
bind -r J resize-pane -D
bind -r K resize-pane -U
bind -r L resize-pane -R
# Selecting windows
bind-key -n C-k next-window
bind-key -n C-j previous-window
# Reordering windows
bind n swap-window -t -1 \; previous-window
bind m swap-window -t +1 \; next-window
# History
set -g history-limit 20000
# Update frequency
set -g status-interval 5
# The pane border style
set -g pane-border-style bg=colour0
set -g pane-border-style fg=colour237
set -g pane-active-border-style fg=colour0
set -g pane-active-border-style fg=colour237
# Message style
set -g message-command-style bg=colour236
set -g message-style bg=colour236
setw -g clock-mode-colour colour8
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
setw -g aggressive-resize on
# Status bar
set -g status-position bottom
set -g status-justify left
# Inactive window style
setw -g window-status-style 'fg=colour243'
setw -g window-status-format '#I #W '
# Active window style
setw -g window-status-current-style 'fg=colour70 bold'
setw -g window-status-current-format '#I #W '
set -g display-panes-colour 'colour70'
set -g display-panes-active-colour 'colour70'
# Left side
set -g status-style 'bg=colour235 fg=colour250'
set -g status-left '#[fg=colour254]#S '
# Right side
tm_spotify="#[fg=colour235,bg=colour166] #($DOTFILES/spotify_info.sh)"
tm_zoom="#[bold]#{?window_zoomed_flag,🔍,}"
tm_docker="#[bg=colour38,fg=colour254 dim] #(docker ps -q | wc -l)"
tm_kube="#[bg=colour24,fg=colour253 dim] #(kubectl config current-context)"
tm_time="#[fg=colour235,bg=colour241] %R %d %b "
set -g status-right $tm_zoom' '$tm_spotify' '$tm_kube' '$tm_docker' '$tm_time' '"#{continuum_status}"
set -g status-right-length 100
set -g status-left-length 20
# Vim-tmux navigator
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind h if-shell "$is_vim" 'send-keys C-b h' 'select-pane -L'
bind j if-shell "$is_vim" 'send-keys C-b j' 'select-pane -D'
bind k if-shell "$is_vim" 'send-keys C-b k' 'select-pane -U'
bind l if-shell "$is_vim" 'send-keys C-b 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 -T copy-mode-vi 'h' select-pane -L
#bind -T copy-mode-vi 'j' select-pane -D
#bind -T copy-mode-vi 'k' select-pane -U
#bind -T copy-mode-vi 'l' select-pane -R
#bind -T copy-mode-vi '\' select-pane -l
#set -g @continuum-save-interval '10'
set -g @resurrect-strategy-nvim 'session'
#run-shell ~/tmux-resurrect/resurrect.tmux
##
## Plugins
##
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'
## Don't put anything above here
run '~/.tmux/plugins/tpm/tpm'