Skip to content

Instantly share code, notes, and snippets.

@blaxill
Created August 18, 2022 15:00
Show Gist options
  • Save blaxill/1d3b4f5691c202a4a376a19d76b467e7 to your computer and use it in GitHub Desktop.
Save blaxill/1d3b4f5691c202a4a376a19d76b467e7 to your computer and use it in GitHub Desktop.
set -g default-terminal "xterm-256color"
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
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"
unbind C-b
set -g prefix 'C-\'
bind 'C-\' send-prefix
unbind %
unbind '"'
bind \\ split-window -h
bind - split-window -v
bind-key x kill-pane
bind -n S-Left previous-window
bind -n S-Right next-window
set -g mouse on
LISTEN_PREFIX='#[bg=green]#[fg=black][!]#[default]'
RIGHT_STATUS="#P"
STATUS='%H:%M#[default] %d %b | #[fg=green]#(whoami)#[default]@#h'
set -g status on
set -g status-left '%H:%M#[default] %d %b'
set -g status-right "#{?client_prefix,$LISTEN_PREFIX,$RIGHT_STATUS}"
set -g status-justify left
set -g status-bg colour235
set -g status-fg white
set -g pane-border-style bg=colour235
set -g pane-border-style fg=colour237
set -g pane-active-border-style bg=colour36
set -g pane-active-border-style fg=colour36
set -g window-status-current-style fg=black,bg=green
set -g set-titles on
set -g base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment