Files
dotfiles/tmux.conf
2022-06-03 14:48:02 -07:00

75 lines
1.9 KiB
Bash

# Longer scrollback
set-window-option -g history-limit 50000
# Enable mouse mode
set-window-option -g mouse on
# Vi keys in copy mode
set-window-option -g mode-keys vi
# Switch prefix from C-b to C-t
unbind C-b
set -g prefix C-s
bind -r C-s send-prefix
# Sourcing config
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# useful bind-key options
# -n works without prefix
# -r repeats without prefix
# Pane navigation commands
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
## Resizing panes
# Fine adjustment (1 or 2 cursor cells per bump)
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Coarse adjustment (5 or 10 cursor cells per bump)
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# Splitting panes
bind - split-window -v -c '#{pane_current_path}'
bind \\ split-window -h -c '#{pane_current_path}'
# New window at current path
bind c new-window -c '#{pane_current_path}'
# Break pane into new window
bind b break-pane -d
# Status bar themeing
set-option -g status-bg '#666666'
set-option -g status-fg '#aaaaaa'
# Start window/pane indices at 1, and renumber as they are created/destroyed
set-option -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
# Toggle mouse-mode
bind m set-window-option mouse
# Window switching with my mouse
bind -n C-Pageup previous-window
bind -n C-Pagedown next-window
# Copy/paste
bind C-c run "tmux show-buffer | xsel -i --clipboard"
bind C-v run "tmux set-buffer \"$(xsel --clipboard)\"; tmux paste-buffer"
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'xsel -i -f'
bind -T root MouseDown2Pane run "tmux set-buffer \"$(xsel)\"; tmux paste-buffer"