Skip to content

Instantly share code, notes, and snippets.

@mikebratt
Created May 5, 2023 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebratt/92e1e7a23e839a7aa49dc40b016fdf92 to your computer and use it in GitHub Desktop.
Save mikebratt/92e1e7a23e839a7aa49dc40b016fdf92 to your computer and use it in GitHub Desktop.
tmux config
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse-select-window off
set -g mouse-select-pane off
set -g mouse-resize-pane off
# Enable mouse mode (tmux 2.1 and above) tmux -V
#set -g mouse on
#
# Toggle mouse on with ^a m
bind m \
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off with ^a M
bind M \
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment