-
Notifications
You must be signed in to change notification settings - Fork 1
/
dottmux.conf
168 lines (129 loc) · 5.28 KB
/
dottmux.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
# My tmux configuration file
# You can reload by running: tmux source-file ~/.tmux.conf
# Use ` as the escape key
set -g prefix `
bind-key ` send-prefix
# reload config
bind r source-file ~/.tmux.conf
# Some screen muscle memory
# Rename window
unbind-key A
bind-key A command-prompt "rename-window %%"
# Window list and nvaigation
unbind-key '"'
bind-key '"' choose-window
# Navigate between sessions/windows (useful when remoting)
if-shell "tmux -V | grep 2.3" "bind ' ' choose-tree -u" "bind ' ' choose-tree -N -F '#W'"
# split panes and restore
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind C-Up resize-pane -U 15
bind C-Down resize-pane -D 15
bind C-Left resize-pane -L 25
bind C-Right resize-pane -R 25
bind % next-layout
bind Z resize-pane -Z
bind C-Space select-pane -m
# with no args join-pane will use marked pane
bind j join-pane
# Window creation
bind c new-window -a
bind f new-window -a -n fish! fish
bind C command-prompt -p "Enter command:" "new-window -a -n %1 %1"
# Move windows
# Set base-index to 1 (0 is reserved for Emacs)
set -g base-index 1
# auto re-number windows as we close old ones
set -g renumber-windows on
#bind Left
bind S command-prompt -p "Swap window with:" "swap-window -t %%"
bind M command-prompt -p "Send pane to session:" "move-window -t '%%':"
# Shell into a box
bind s command-prompt -p "Enter ssh user/host:" "new-window -a -n %1 'ssh %1'"
bind m command-prompt -p "Enter mosh user/host:" "new-window -a -n %1 'mosh %1'"
# Listen to a port
bind l command-prompt -p "Enter netcat port:" "new-window -a -n 'netcat:%1' 'nc.openbsd -tkl 127.0.0.1 %1'"
# Take me to my editor
bind E new-window -n "Emacs" -t 0 -k "emacsclient -a '' -t"
bind e select-window -t "Emacs"
# Copy/paste handling
# a normal escapes M-w brings up emacs
#bind M-w save-buffer ~/.tmux-buffer
#bind M-w save-buffer ~/.tmux-buffer \; new-window -n "CopyTMUX" -a "emacsclient -t -a '' ~/.tmux-buffer"
bind -T copy-mode M-w send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Environment handling
# This replaces the hacky "restore_gui_env" I used for screen
set -g update-environment "SSH_AGENT_PID SSH_AUTH_SOCK SSH_CLIENT SSH_TTY SSH_CONNECTION SWAYSOCK GPG_AGENT_INFO GPG_TTY DISPLAY WALAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS XDG_SESSION_COOKIE"
# We live in a UTF-8 world with colour terminals
# more recent tmux-en default to UTF-8 and this option has been dropped
setw -q -g utf8 on
set -g default-terminal screen-256color
set -ga terminal-overrides ",st-256color:Tc,stterm-256color:Tc,xterm-256color:Tc"
set -ga terminal-features ",alacritty*:RGB,foot*:RGB"
# This ensures new shells get the full profile loaded but are
# not treated as login shells.
set -g default-command "/bin/bash --init-file ~/.bash_profile"
# Window titles
set -g set-titles on
set -g set-titles-string "@#h/#W"
# History
set -g history-limit 8192
# Emacs key bindings
setw -g mode-keys emacs
# Don't wait too long for another escape sequence
set -g escape-time 0
# Resize agresively
setw -g aggressive-resize on
# Allow mouse to work (nope - breaks X copy&paste)
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
# Tweak mode line to be more visible
# set -g status-left "#[fg=red,bg=black]@#h/#S#[fg=blue]|"
# set -g status-left-length 16
# # names in the middle
# set -g status-justify left
# set -g status-style "fg=yellow,bg=blue"
# # show load avg on right
# set -g status-right-length 60
# set -g status-right "#[fg=white,bg=black]#{?client_prefix,#[reverse],}#(tmux show-option -g prefix)#[noreverse] #[fg=yellow](lavg #(uptime | cut -d ' ' -f 14-16)) #[fg=white]%a %b %e %H:%M"
# Plugins!
set -g @plugin 'catppuccin/tmux'
# set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tpm'
# Catppuccin tweaks
# use icons for status
set -g @catppuccin_window_status_enable "yes"
set -g @catppuccin_window_status_icon_enable "yes"
set -g @catppuccin_icon_window_last ""
set -g @catppuccin_icon_window_current "🡄"
set -g @catppuccin_icon_window_zoom " "
set -g @catppuccin_icon_window_mark " "
set -g @catppuccin_icon_window_silent ""
set -g @catppuccin_icon_window_activity ""
set -g @catppuccin_icon_window_bell ""
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator "█ "
set -g @catppuccin_window_number_position "left"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules "host session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{pane_current_path}"
set -g @resurrect-processes 'ssh nc emacs cat htop less fish "nc.openbsd -tkl 127.0.0.1 4444"'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
if-shell 'test -f /usr/share/tmux-plugin-manager/tpm' {
run /usr/share/tmux-plugin-manager/tpm
}
if-shell 'test -f ~/.tmux/plugins/tpm/tpm' {
run ~/.tmux/plugins/tpm/tpm
}