diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..42ab3f6 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,63 @@ +# ---------- Basics ---------- +set -g mouse on +set -g history-limit 50000 +setw -g mode-keys vi +set -g default-terminal "screen-256color" +set -ga terminal-overrides ",xterm-256color:Tc" # true color if your terminal supports it +set -sg escape-time 10 # snappier ESC, fixes vim lag +set -g focus-events on + +# ---------- Sensible numbering ---------- +set -g base-index 1 # windows start at 1, not 0 +setw -g pane-base-index 1 +set -g renumber-windows on # close window 2 of 1,2,3 → renumbers to 1,2 + +# ---------- Better prefix (optional) ---------- +# Ctrl-b is awkward; many people remap to Ctrl-a (like screen). +# Comment this block out if you'd rather keep Ctrl-b. +unbind C-b +set -g prefix C-a +bind C-a send-prefix + +# ---------- Saner splits ---------- +# Default bindings are " and % — impossible to remember. Use | and -. +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +# New windows open in the current directory too +bind c new-window -c "#{pane_current_path}" + +# ---------- Pane navigation ---------- +# Vim-style hjkl movement between panes +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Resize panes with Prefix + H/J/K/L (repeatable) +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# ---------- Reload config ---------- +bind r source-file ~/.tmux.conf \; display "Config reloaded" + +# ---------- Copy mode niceties ---------- +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send -X copy-selection-and-cancel + +# ---------- Status bar ---------- +set -g status-interval 5 +set -g status-left-length 30 +set -g status-right-length 60 +set -g status-left "#[bold] #S #[default]│ " +set -g status-right "│ %a %Y-%m-%d %H:%M " +# set -g status-style "bg=default fg=default" +setw -g window-status-current-style "bold" + +# ---------- Activity / bells ---------- +# setw -g monitor-activity on +# set -g visual-activity off # don't beep, just highlight in status bar