updated tmux.conf

This commit is contained in:
tonybanters 2025-11-13 01:43:28 -08:00
commit 4555180194
2 changed files with 29 additions and 171 deletions

View file

@ -1,48 +1,47 @@
# ============================================================================
# BASIC SETTINGS
# ============================================================================
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*:RGB"
set -g mouse on
set -g set-clipboard on
# ============================================================================
# KEY BINDINGS
# ============================================================================
# Change prefix from Ctrl-b to Ctrl-a
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
# Vim-style pane navigation
# Vim like pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Split windows (opens in same directory as current pane)
unbind %
unbind '"'
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# Reload config
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
unbind r
bind r source-file $HOME/.config/tmux/tmux.conf
# Alt+hjkl to switch panes without prefix
# Change from 0 based to 1 based because keyboard layout
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Vim-like copy/paste
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
unbind -T copy-mode-vi MouseDragEnd1Pane
# Alt+hjkl to switch panes (vim-style)
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Shift+arrows to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Alt+number to select window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
@ -54,28 +53,7 @@ bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# ============================================================================
# WINDOWS & PANES
# ============================================================================
# Start numbering at 1 (easier to reach on keyboard)
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# ============================================================================
# COPY MODE (Vim-style)
# ============================================================================
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
unbind -T copy-mode-vi MouseDragEnd1Pane
# ============================================================================
# THEME COLORS (Tokyo Night Moon)
# ============================================================================
# Tokyonight Moon theme colors
thm_bg="#222436"
thm_fg="#c8d3f5"
thm_cyan="#86e1fc"
@ -90,9 +68,7 @@ thm_blue="#82aaff"
thm_orange="#ff9e64"
thm_black4="#444a73"
# ============================================================================
# STATUS BAR SETTINGS
# ============================================================================
# Status bar
set -g status "on"
set -g status-bg "${thm_bg}"
set -g status-justify "left"
@ -112,31 +88,19 @@ set -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
set -g window-status-separator ""
set -g window-status-style "fg=${thm_fg},bg=${thm_bg},none"
# ============================================================================
# STATUS BAR LAYOUT
# ============================================================================
# Statusline - current window
set -g window-status-current-format "#[fg=${thm_blue},bg=${thm_bg}] #I: #[fg=${thm_magenta},bg=${thm_bg}](✓) #[fg=${thm_cyan},bg=${thm_bg}]#(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) #[fg=${thm_magenta},bg=${thm_bg}]"
# Define reusable style components
status_bg="#[fg=${thm_fg},bg=${thm_gray}]"
status_indicator="#{?client_prefix,#[fg=${thm_magenta}],#[fg=${thm_cyan}]}"
window_index="#[fg=${thm_blue},bg=${thm_bg}] #I:"
short_path="#(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev)"
# Statusline - other windows
set -g window-status-format "#[fg=${thm_blue},bg=${thm_bg}] #I: #[fg=${thm_fg},bg=${thm_bg}]#W"
# Left side (empty)
# Statusline - right side
set -g status-right "#[fg=${thm_blue},bg=${thm_bg},nobold,nounderscore,noitalics]#[fg=${thm_bg},bg=${thm_blue},nobold,nounderscore,noitalics] #[fg=${thm_fg},bg=${thm_gray}] #W #{?client_prefix,#[fg=${thm_magenta}],#[fg=${thm_cyan}]}#[bg=${thm_gray}]#{?client_prefix,#[bg=${thm_magenta}],#[bg=${thm_cyan}]}#[fg=${thm_bg}] #[fg=${thm_fg},bg=${thm_gray}] #S "
# Statusline - left side (empty)
set -g status-left ""
# Right side shows: [window_name] [●] [session_name]
# ● indicator changes cyan→magenta when prefix is pressed
set -g status-right "#[fg=${thm_blue},bg=${thm_bg}]#[fg=${thm_bg},bg=${thm_blue}] ${status_bg} #W ${status_indicator}#[bg=${thm_gray}]#{?client_prefix,#[bg=${thm_magenta}],#[bg=${thm_cyan}]}#[fg=${thm_bg}] ${status_bg} #S "
# Active window format: [number: (✓) parent/dir]
set -g window-status-current-format "${window_index} #[fg=${thm_magenta},bg=${thm_bg}](✓) #[fg=${thm_cyan},bg=${thm_bg}]${short_path} #[fg=${thm_magenta},bg=${thm_bg}]"
# Inactive window format: [number: name]
set -g window-status-format "${window_index} #[fg=${thm_fg},bg=${thm_bg}]#W"
# ============================================================================
# MODES
# ============================================================================
# Modes
set -g clock-mode-colour "${thm_blue}"
set -g mode-style "fg=${thm_blue} bg=${thm_black4} bold"

View file

@ -1,106 +0,0 @@
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*:RGB"
set -g mouse on
set -g set-clipboard on
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
# Vim like pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
unbind %
bind | split-window -h -c "#{pane_current_path}"
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
unbind r
bind r source-file $HOME/.config/tmux/tmux.conf
# Change from 0 based to 1 based because keyboard layout
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Vim-like copy/paste
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
unbind -T copy-mode-vi MouseDragEnd1Pane
# Alt+hjkl to switch panes (vim-style)
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Alt+number to select window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# Tokyonight Moon theme colors
thm_bg="#222436"
thm_fg="#c8d3f5"
thm_cyan="#86e1fc"
thm_black="#1b1d2b"
thm_gray="#3a3f5a"
thm_magenta="#c099ff"
thm_pink="#ff757f"
thm_red="#ff757f"
thm_green="#c3e88d"
thm_yellow="#ffc777"
thm_blue="#82aaff"
thm_orange="#ff9e64"
thm_black4="#444a73"
# Status bar
set -g status "on"
set -g status-bg "${thm_bg}"
set -g status-justify "left"
set -g status-left-length "100"
set -g status-right-length "100"
# Messages
set -g message-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
set -g message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
# Panes
set -g pane-border-style "fg=${thm_gray}"
set -g pane-active-border-style "fg=${thm_blue}"
# Windows
set -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
set -g window-status-separator ""
set -g window-status-style "fg=${thm_fg},bg=${thm_bg},none"
# Statusline - current window
set -g window-status-current-format "#[fg=${thm_blue},bg=${thm_bg}] #I: #[fg=${thm_magenta},bg=${thm_bg}](✓) #[fg=${thm_cyan},bg=${thm_bg}]#(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) #[fg=${thm_magenta},bg=${thm_bg}]"
# Statusline - other windows
set -g window-status-format "#[fg=${thm_blue},bg=${thm_bg}] #I: #[fg=${thm_fg},bg=${thm_bg}]#W"
# Statusline - right side
set -g status-right "#[fg=${thm_blue},bg=${thm_bg},nobold,nounderscore,noitalics]#[fg=${thm_bg},bg=${thm_blue},nobold,nounderscore,noitalics] #[fg=${thm_fg},bg=${thm_gray}] #W #{?client_prefix,#[fg=${thm_magenta}],#[fg=${thm_cyan}]}#[bg=${thm_gray}]#{?client_prefix,#[bg=${thm_magenta}],#[bg=${thm_cyan}]}#[fg=${thm_bg}] #[fg=${thm_fg},bg=${thm_gray}] #S "
# Statusline - left side (empty)
set -g status-left ""
# Modes
set -g clock-mode-colour "${thm_blue}"
set -g mode-style "fg=${thm_blue} bg=${thm_black4} bold"