-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
128 lines (100 loc) · 3.67 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
unbind C-a
unbind C-b
unbind C-Space
# set space as prefix
set -g prefix C-a # screen compatibility
set -g prefix C-Space
# use a different prefix for nested
bind-key -n C-y send-prefix
# add double-tap meta key to toggle
# if theres more than one window, switch to last window
# if theres only one window, try to toggle between panes
bind-key C-Space if-shell 'test $(tmux list-windows | wc -l) -gt 1' 'last-window' 'last-pane'
# pane colors and display
# create more intuitive split key combos (same as modern screen)
unbind |
bind | split-window -h
bind '\' split-window -h
bind 'C-\' split-window -h
unbind -
unbind _
bind - split-window -v
bind _ split-window -v
# vi for copy mode
setw -g mode-keys vi
# vi for command status
set -g status-keys vi
# vi keys to resize
bind -r C-k resize-pane -U 2
bind -r C-j resize-pane -D 2
bind -r C-h resize-pane -L 2
bind -r C-l resize-pane -R 2
# vi keys to navigate panes
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# avoid cursor movement messing with resize
set -g repeat-time 200
# prompt me to open any URLs on current tmux buffer
# save the buffer, remove newlines to fix URLs split
# across multiple lines
# https://sean.fish/d/urlhandler?dark
bind -r u capture-pane -S -32768 \; save-buffer /tmp/tmux_buf \; run -b "cat /tmp/tmux_buf | tr -d '\n' | urlhandler --urlextract >/dev/null &"
# colors, clock, and stuff
set -g clock-mode-style 12
# use xterm-256color isntead of alacritty, since it doesnt seem like
# mac handles that properly
# https://github.com/alacritty/alacritty/issues/2487
set -g default-terminal "xterm-256color"
set -g base-index 1
setw -g pane-base-index 1
bind -r C-x confirm kill-server
bind -r x kill-pane
# color the pane borders nearly invisible
# (when not using hacked tmux without them)
set -g pane-border-style "fg=#111111"
set -g pane-active-border-style "fg=#111111"
# setting the delay between prefix and command
set -s escape-time 5
# avoid tmux from eating the shift keys
set-window-option -g xterm-keys on
# reload configuration
bind -r r source-file ~/.tmux.conf
# set C-prefix C-w to choose window as well
bind -r C-w choose-window
# disable status
# set -g status off
# enable mouse, to enter copy mode quickly (otherwise use prefix [)
set -g mouse on
# very unique Mac bug
if-shell "type 'reattach-to-user-namespace' >/dev/null" "set -g default-command 'reattach-to-user-namespace -l $SHELL'"
# styling
# set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# see https://sean.fish/d/termcolors?dark for a script to get colors
# modes
# setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour1 bg=colour232 bold'
# panes
set -g pane-border-style 'fg=colour239 bg=default'
set -g pane-active-border-style 'fg=colour4 bg=default'
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=colour232 fg=colour137 dim'
set -g status-left ''
set -g status-right '' # disable current time
set -g status-right-length 50
set -g status-left-length 20
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
setw -g window-status-current-style 'fg=colour1 bg=colour236 bold'
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
# setw -g window-status-style 'fg=colour9 bg=colour236'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'