Skip to content

Instantly share code, notes, and snippets.

@kernelvoid17
Last active December 4, 2025 07:41
Show Gist options
  • Select an option

  • Save kernelvoid17/c140d5b5f61f80dc9602a54a14197b39 to your computer and use it in GitHub Desktop.

Select an option

Save kernelvoid17/c140d5b5f61f80dc9602a54a14197b39 to your computer and use it in GitHub Desktop.
# set-option -g default-shell /usr/local/bin/fish
set -gu pane-active-border-style
set -g pane-border-style fg=default
set -g pane-border-style fg=colour238
set -g pane-active-border-style fg=colour238
set -g mouse on
set -g history-limit 10000
unbind -n C-Tab
unbind -n C-S-Tab
unbind -n M-t
unbind -n M-w
bind-key -n C-Tab next-window
bind-key -n C-S-Tab previous-window
bind-key -n M-t new-window
bind-key -n M-w kill-window
unbind -n M-l
bind-key -n M-l choose-session
unbind -n M-n
bind-key -n M-n new-session
unbind -n M-\\
bind-key -n M-\\ split-window -h
# set-option -g status-right ""
# set-option -g status-right-length 0
set -g status off
vim_pattern='(\\S+\\/)?g?\.?(view|l?n?vim?x?|fzf)(diff)?(-wrapped)?$'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +${vim_pattern}'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment