dotfiles/tmux/tmux.conf

82 lines
2 KiB
Bash

# set default terminal
#set -ga terminal-overrides ",xterm-kitty:Tc,alacritty:Tc,xterm-termite:Tc"
set-option -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ',tmux-256color:Tc,xterm-256color:Tc,alacritty:Tc'
# set mouse/history stuff
set -g mouse on
set -g history-limit 20000
set-option -g focus-events on
# rebind prefix
set -g prefix C-a
bind C-a send-prefix
# always renumber windows
set -g renumber-windows on
# tile all windows
unbind =
bind = select-layout tiled
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
# Set titles
set-option -g set-titles on
# set-option -g set-titles-string "#T - #W"
# Set status bar
set -g status-bg black
set -g status-fg white
######################
#### Key Bindings ####
######################
# Unbind Arrow keys
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
# synchronize all panes in window
bind y setw synchronize-panes
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize-panes
bind Right resize-pane -R 10
bind Left resize-pane -L 10
bind Up resize-pane -U 10
bind Down resize-pane -D 10
# Move windows options
bind C-h previous-window
bind C-l next-window
# vim-like copy-mode
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -Tcopy-mode-vi 'v' send -X begin-selection
# Mac OS X fix for pbcopy, pbpaste, and launchctl
# set-option -g default-command "safe-reattach-to-user-namespace -l $SHELL"
# the first part checks whether we're macOS or not, and then uses either safe-reattach... or xclip depending on detected OS
if-shell 'test "$(uname)" = "Darwin"' 'bind -Tcopy-mode-vi "y" send -X copy-pipe-and-cancel "safe-reattach-to-user-namespace pbcopy"' 'bind -Tcopy-mode-vi "y" send -X copy-pipe-and-cancel "xclip -in -selection clipboard &> /dev/null"'
# split-windows
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
set -s escape-time 0