Skip to content

Instantly share code, notes, and snippets.

@sr8e
Last active July 10, 2025 08:24
Show Gist options
  • Select an option

  • Save sr8e/cc3ce1390258646dadbf8b9a7e29a362 to your computer and use it in GitHub Desktop.

Select an option

Save sr8e/cc3ce1390258646dadbf8b9a7e29a362 to your computer and use it in GitHub Desktop.
##### keybinds ######
# change prefix key
unbind-key C-b
set -g prefix C-q
bind C-q send-prefix # send C-q to terminal
# reload settings
bind r source-file ~/.tmux.conf
# split pane
bind / split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# move pane with no prefix alt+cursor
bind -n M-UP select-pane -U
bind -n M-DOWN select-pane -D
bind -n M-LEFT select-pane -L
bind -n M-RIGHT select-pane -R
# resize pane with S-hjkl (continuously)
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
# change window with h/l
bind h previous-window
bind l next-window
# open window with n, and in current path with N
bind n new-window
bind N new-window -c "#{pane_current_path}"
# kill window with X
bind X confirm-before -p "close window #W? (y/N)" kill-window
# vim style copying
set -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection
##### enable mouse #####
set -g mouse on
# use wheel to scroll
set -g terminal-overrides "xterm*:smcup@:rmcup@"
##### visual settings #####
# enable colors
set -g default-terminal "xterm-256color"
# support undercurl, underscore colors
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
# change background if active
set -g window-active-style "bg=colour235"
#status lines
set -g status-interval 1
set -g status-bg "colour16"
set -g status-fg "colour255"
set -g status-justify left
set -g status-left-length 30
set -g status-left "#[fg=colour16]#{?client_prefix,#[bg=colour3],#[bg=colour2]} \
#{?client_prefix,\ue009,\uf120} Session ###S #[default]#[bg=colour16]\
#{?client_prefix,#[fg=colour3],#[fg=colour2]}\ue0b4 #[fg=colour250]\uf2d2 window:"
set -g window-status-current-format " #[fg=colour88, bg=colour16]\ue0b6\
#[bg=colour88, fg=colour255]###I#F\ue0b5#[fg=colour255] \
(#P)#W@#{b:pane_current_path} #[fg=colour88, bg=colour16]\ue0b4"
set -g window-status-format " #[fg=colour88]\ue0b7#[fg=colour250]###I#F#[fg=colour88]\ue0b5\
#[fg=colour250] (#P)#W@#{b:pane_current_path} #[fg=colour88]\ue0b5"
set -g status-right "#{?client_prefix,#[fg=colour3],#[fg=colour2]}\ue0b6\
#[fg=colour16]#{?client_prefix,#[bg=colour3],#[bg=colour2]} #T "
##### misc #####
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
set -s escape-time 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment