summaryrefslogtreecommitdiff
path: root/terminal/.config/tmux/tmux.conf
diff options
context:
space:
mode:
Diffstat (limited to 'terminal/.config/tmux/tmux.conf')
-rw-r--r--terminal/.config/tmux/tmux.conf117
1 files changed, 117 insertions, 0 deletions
diff --git a/terminal/.config/tmux/tmux.conf b/terminal/.config/tmux/tmux.conf
new file mode 100644
index 0000000..1070843
--- /dev/null
+++ b/terminal/.config/tmux/tmux.conf
@@ -0,0 +1,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