Skip to content

Instantly share code, notes, and snippets.

@fffergal
Last active July 23, 2026 18:34
Show Gist options
  • Select an option

  • Save fffergal/a04dfbfd5d4e4d61ba677e96cffc77ed to your computer and use it in GitHub Desktop.

Select an option

Save fffergal/a04dfbfd5d4e4d61ba677e96cffc77ed to your computer and use it in GitHub Desktop.
# Basic settings
set -g mode-keys vi
set -g status-keys vi
set -g mouse on
set -g set-titles off
set -g set-clipboard external
set -g history-limit 2000000
set -g repeat-time 1000
# Status bar
set -g status-bg black
set -g status-fg brightgreen
set -g status-left "#{?mouse,⬁,#[fg=blue]⫯#[default]}#{?client_prefix,#[fg=blue]⌃#[default],⌄}#{?cursor_flag,⬉,#[fg=blue]◌#[default]}#{?alternate_on,#[fg=blue]⤢#[default],╬}#{?mouse_any_flag,#[fg=blue]⬁#[default],⌨}#{?mouse_button_flag,#[fg=blue]■#[default],□}#{?mouse_sgr_flag,#[fg=blue]✦#[default],✧} "
set -g status-right ""
set -g window-status-style bg=black
set -g window-status-current-style fg=green
set -g window-status-last-style fg=brightblue
set -g window-status-style fg=brightgreen
set -g window-status-separator "  "
# Replace Enter and mouse drag behavior to not exit copy mode.
bind -T copy-mode-vi Enter send -X copy-selection
bind -T copy-mode-vi MouseDown1Pane set -g @was_in_copy_mode 1 \; select-pane \; send -X mouse
bind -T root MouseDown1Pane set -g @was_in_copy_mode 0 \; select-pane -t= \; send-keys -M
bind -T copy-mode-vi MouseDragEnd1Pane if -F "#{@was_in_copy_mode}" "send -X copy-selection" "send -X copy-selection-and-cancel"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
bind -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
# Don't capture the mouse for a couple of seconds so I can click URLs
bind-key C-r run-shell -b '( tmux set -g mouse off ; sleep 2 ; tmux set -g mouse on ) >/dev/null'
# Split window and keep current directory
bind-key \\ split-window -c '#{pane_current_path}'
# Let OSC52 clipboard sharing work through mosh too
set-option -ag terminal-overrides ",xterm-256color:Ms=\\E]52;c;%p2%s\\7"
set-option -ag terminal-overrides ",xterm-kitty:Ms=\\E]52;c;%p2%s\\7"
# Move window left and right
bind -r C-h swap-window -t -1\; select-window -t -1
bind -r C-l swap-window -t +1\; select-window -t +1
# Cycle through panes but zoomed.
bind -r ` select-pane -t :.+ \; resize-pane -Z
# Slower scrolling with trackpad
bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up
bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down
# Solarized dark color scheme uses one of the ANSI colors (8 or brightblack) as
# the same as the background color. If a fancy TUI decides to use it for text,
# it's invisible. Quickly swap it for brightcyan (lighter emphasized text in
# Solarized dark, which is probably what the fancy TUI intended) in the current
# pane only, so it can be read.
bind k if-shell -F '#{pane-colours[8]}' 'set -pu pane-colours[8]' 'set -p pane-colours[8] brightcyan'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment