summaryrefslogtreecommitdiff
path: root/terminal/.config/tmux/tmux.conf
blob: 10708437883bbbac5f9cc259d38b35cdefbb4122 (plain)
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
unbind C-b
unbind C-Space
set-option -g prefix C-Space
bind C-Space send-prefix

# Source: https://michenriksen.com/notes/alacritty-tmux-neovim-colors-and-undercurl/#codeblock-01
set -g default-terminal "tmux-256color"
# Enable undercurl and color.
set -ga terminal-features ",*:usstyle"
# Support RGB color with SGR escape sequences.
set -gs terminal-overrides ",*:RGB"

set -g mouse on
set -g base-index 1
setw -g xterm-keys on
set -s escape-time 10
set -sg repeat-time 600
set -s focus-events on

set -g status-position bottom
set -g status-justify centre
set-option -g status-style bg=#181A1B

set-option -ag message-style fg=yellow,blink
set-option -ag message-style bg=default

set -g status-left '#[fg=blue,bg=white,bold] 󰏉 #S #[bg=default] '
set -g status-left-length 20

set -g @tpm_plugins "tmux-plugins/tpm soyuka/tmux-current-pane-hostname"

set -g status-right "#[fg=none,bg=none]#{?client_prefix,⌨  ,  }#[fg=orange,bg=black] #H #[fg=black,bg=orange] %a "
set -g status-right-length 50

set-window-option -g window-status-separator '  '
set-window-option -g window-status-current-style 'bold'
set-window-option -g window-status-last-style 'bold'
set-window-option -g window-status-style 'none'

set-window-option -g window-status-current-format '#[fg=white,bg=blue] #I| #W '
set-window-option -g window-status-format '#[fg=lightblue] #I| #W '

set-window-option -g pane-active-border-style "bg=default fg=#fdf070"

# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on

# Bindings

bind \; command-prompt
bind r command-prompt -I "rename-window #{window_name}"
bind e command-prompt -I "rename-session #{session_name}"

# Source: https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# split panes using | and -
bind | split-window -h -c '#{pane_current_path}'
bind \\ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind _ split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %

# Split right, left, down, up
# bind -r C-l split-pane -h -c '#{pane_current_path}'
# bind -r C-h split-pane -hb -c '#{pane_current_path}'
# bind -r C-j split-pane -v -c '#{pane_current_path}'
# bind -r C-k split-pane -vb -c '#{pane_current_path}'

bind Enter new-window -c '#{pane_current_path}'

# Source: https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# 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

bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D

bind -r h select-pane -L
bind -r l select-pane -R
bind -r k select-pane -U
bind -r j select-pane -D

bind -r [ select-pane -t :.-
bind -r ] select-pane -t :.+

bind -r p previous-window
bind -r n next-window

bind -r Space next-layout

# Resize right, left, down, up
bind -r -T prefix M-k resize-pane -U 5
bind -r -T prefix M-j resize-pane -D 5
bind -r -T prefix M-h resize-pane -L 5
bind -r -T prefix M-l resize-pane -R 5
bind -r -T prefix C-k resize-pane -U
bind -r -T prefix C-j resize-pane -D
bind -r -T prefix C-h resize-pane -L
bind -r -T prefix C-l resize-pane -R

# Easier vertical scroll
bind -n M-U copy-mode -e \; send-keys -X -N 5 scroll-up
bind -T copy-mode M-D copy-mode -e \; send-keys -X -N 5 scroll-down

set -gq allow-passthrough on
set -g visual-activity off
set-option -ga terminal-features ",alacritty:usstyle"

# Source: https://github.com/soyuka/tmux-current-pane-hostname
run-shell ~/.config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux