dotfiles/.config/tmux/tmux.conf
2023-09-03 21:36:50 +10:00

61 lines
2.0 KiB
Bash

# Use Ctrl a as the control key
set-option -g prefix C-a
unbind C-a
bind C-a send-prefix
# Enable mouse support
set-option -g mouse on
# Set vi mode for easier navigation
set-window-option -g mode-keys vi
# Allow vim-like copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# Use the same key binding for both copy mode and paste buffer
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind C-a paste-buffer
# Enable larger scrollback buffer
set-option -g history-limit 10000
# Splitting panes with Ctrl a + % (vertical) and Ctrl a + " (horizontal)
bind '"' split-window -h
bind % split-window -v
# Set status bar
set-option -g status on
set-option -g status-position "bottom"
set-option -g status-interval 5
set-option -g status-justify "left"
set-option -g status-left-length 5
set-option -g status-left "#[fg=orange]#S "
set-option -g status-right " #[fg=green]%H:%M %d-%b-%y"
set-option -g status-right-length 30
set-option -g status-style "bg=default,fg=green"
#set-option -g status-style bg=colour235,fg=default
# Change window options
set-window-option -g window-style 'fg=default,bg=default'
set-window-option -g window-active-style 'fg=default,bg=default'
set-window-option -g window-status-separator ' '
set-window-option -g window-status-current-style 'bg=default bold'
set-window-option -g window-status-last-style 'bg=default'
# Reorder window indexes with CTRL+SHIFT+Left/Right
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# Bind a key to synchronize input to all panes
bind-key C-s setw synchronize-panes
# Reload config without detaching the session
bind R source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!"
# Automatic window renaming
set-window-option -g automatic-rename on
# Start with window index 1
set-option -g base-index 1