-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
111 lines (87 loc) · 3.53 KB
/
tmux.conf
File metadata and controls
111 lines (87 loc) · 3.53 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
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'b0o/tmux-autoreload'
set -g @plugin 'AngryMorrocoy/tmux-neolazygit'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'laktak/extrakto'
set -g @plugin 'tmux-plugins/tmux-open'
# Enable mouse scolling
set -g mouse on
# Sane mouse scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Shutup tmux + mutt
set -g bell-action none
set -g visual-bell off
unbind C-b
set-option -g prefix C-b
set -g status-style 'bg=#333333 fg=#5eacd3'
# Support ^arrows
set-window-option -g xterm-keys on
# act like vim
setw -g mode-keys vi
# Pane resizing
bind ( resize-pane -L 5
bind ) resize-pane -R 5
bind - resize-pane -D 5
bind + resize-pane -U 5
# Set the time in milliseconds for which tmux waits after
# an escape is input to determine if it is part of a function
# or meta key sequences. The default is 500 milliseconds.
set -sg escape-time 0
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set -g pane-base-index 1
setw -g base-index 1
setw -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# Automatically set window title
set-window-option -g automatic-rename on
# increase scrollback lines
set -g history-limit 99999
# By default, all windows in a session are constrained to the size of the
# smallest client connected to that session,
# even if both clients are looking at different windows.
# It seems that in this particular case, Screen has the better default
# where a window is only constrained in size if a smaller client
# is actively looking at it.
setw -g aggressive-resize on
# Swap windows with Shift-Control vim-arrows
bind-key -n C-S-h swap-window -t -1
bind-key -n C-S-l swap-window -t +1
# wezterm zenmode integration
set-option -g allow-passthrough on
# tmux-navigator integration
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
bind-key -r f run-shell "tmux neww ~/.bin/tmux-sessionizer"
bind-key -r S run-shell "~/.bin/tmux-sessionizer ~/src/loop-sdk"
bind-key -r D run-shell "~/.bin/tmux-sessionizer ~/src/dotfiles"
# vim-like pane switching
bind -r z last-window
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# nvim told me to do this, enable true color
set-option -g default-terminal 'tmux-256color'
set -ga terminal-overrides ',xterm-256color:Tc'
set-option -sa terminal-features ',alacritty:Tc'
run '~/.tmux/plugins/tpm/tpm'