Repository navigation
Expand file tree
/
Copy pathdot_tmux.conf.tmpl
More file actions
173 lines (141 loc) · 5.5 KB
/
Copy pathdot_tmux.conf.tmpl
File metadata and controls
173 lines (141 loc) · 5.5 KB
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
set -g default-terminal "tmux-256color"
set -ag terminal-features ',tmux-256color:clipboard'
# Update environment variables when attaching from a different session
set -g update-environment "DISPLAY WAYLAND_DISPLAY SSH_AUTH_SOCK"
set -g display-time 2000 # 2 seconds
# Fix environment for clipboard/SSH in existing panes after attaching (prefix + e)
bind e send-keys 'eval "$(tmux show-env -s DISPLAY 2>/dev/null)"; eval "$(tmux show-env -s WAYLAND_DISPLAY 2>/dev/null)"; eval "$(tmux show-env -s SSH_AUTH_SOCK 2>/dev/null)"; tmux display-message "Environment updated (DISPLAY=${DISPLAY:-unset})"' C-m
# Enable OSC 52 clipboard (works over SSH/nested sessions)
set -g set-clipboard on
# Allow OSC 52 to pass through to terminal (tmux 3.3+)
set -g allow-passthrough on
# remap prefix from 'C-b' to 'C-a'
#unbind C-b
#set-option -g prefix C-a
#bind-key C-a send-prefix
#control key twice to switch to last pane (screen like behavior)
bind-key C-b last-window
# split panes using | and -
bind \\ split-window -h
bind - split-window -v
unbind '"'
unbind %
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# enlarge pane with alt+z
bind -n M-z resize-pane -Z
#Switch window order
#Prefix then Shift-{Left/Right}
bind-key S-Left swap-window -t -1
bind-key S-Right swap-window -t +1
# Toggle outer tmux off/on with F12 or prefix + a
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=colour245,bg=colour238" \;\
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
refresh-client -S
bind a \
set prefix None \;\
set key-table off \;\
set status-style "fg=colour245,bg=colour238" \;\
refresh-client -S
bind -T off a \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
refresh-client -S
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection clipboard 2>/dev/null"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard 2>/dev/null"
# Toggle mouse on
#bind m \
# set -g mouse on \;\
# display 'Mouse: ON'
# Toggle mouse off
#bind M \
# set mouse off \;\
# display 'Mouse: OFF'
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
#pane/window/session count starts @ 1
set -g base-index 1
#increase history
set-option -g history-limit 500000
# status
setw -g window-status-format '#I:#W#F'
set -g status-interval 1
set -g status-justify centre
set -g status-position bottom
#set -g status-bg colour234
#set -g status-fg colour137
#set -g status-attr dim
set -g status-style dim,fg=colour137,bg=colour234
#set -g status-left '#[fg=colour015,bg=colour022,bold] #S@#H #[bg=colour234] '
set -g status-left '#[fg=colour22,bg=colour245,bold] #S@#H #[bg=colour234] '
set -g status-right '#[fg=colour22,bg=colour245,bold] %m/%d %I:%M:%S %p'
#set -g status-right '#[fg=colour015,bg=colour023,bold] %d/%m #[fg=colour015,bg=colour022,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
# window
#setw -g window-status-current-fg colour81
#setw -g window-status-current-fg colour40
#setw -g window-status-current-bg colour238
#setw -g window-status-current-attr bold
setw -g window-status-current-style bold,fg=colour40,bg=colour238
#setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour040]#F '
#setw -g window-status-fg colour138
#setw -g window-status-fg colour028
#setw -g window-status-bg colour235
#setw -g window-status-attr none
setw -g window-status-style none,fg=colour028,bg=colour235
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
#setw -g window-status-bell-attr bold
#setw -g window-status-bell-fg colour255
#setw -g window-status-bell-bg colour1
setw -g window-status-bell-style bold,fg=colour255,bg=colour1
# pane
#set -g pane-border-bg colour235
#set -g pane-border-fg colour238
set -g pane-border-style fg=colour238,bg=colour235
#set -g pane-active-border-bg colour236
#set -g pane-active-border-fg colour34
#set -g pane-active-border-fg colour9
set -g pane-active-border-style fg=colour9,bg=colour236
#Plugin Options
#Ressurcet Pane Contents
set -g @resurrect-capture-pane-contents 'on'
#Plugins
# List of plugins
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
{{- if eq .chezmoi.osRelease.id "arch" "endeavouros" }}
run-shell /usr/share/tmux-resurrect/resurrect.tmux
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '/usr/share/tmux-plugin-manager/tpm'
{{- else}}
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tpm'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
{{- end -}}