Skip to content

Instantly share code, notes, and snippets.

@yankcrime
Created November 14, 2019 10:36
Show Gist options
  • Save yankcrime/159c5deddb357120873645bd54906298 to your computer and use it in GitHub Desktop.
Save yankcrime/159c5deddb357120873645bd54906298 to your computer and use it in GitHub Desktop.
set -g default-terminal "tmux-256color"
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
bind | split-window -h
bind - split-window -v
set-window-option -g mode-keys vi
bind-key space next-window
set -g status-keys vi
set -g base-index 1
set-option -g status-left ' #S § '
set-option -g status-style 'bg=#373b41,fg=white'
set-option -g status-left-length 40
set-option -g status-right "#[fg=yellow,bold]$USER@#h "
set-option -g status-interval 60 # Default is 15.
set-option -w -g window-status-current-style fg=colour49,bold
set -g pane-active-border-style bg=default,fg=colour49
# quickly jump between windows
bind ^space last-window
# manually rename windows
set-option -g allow-rename off
bind , command-prompt "rename-window '%%'"
bind > run-shell "tmux rename-window `basename #{pane_current_path}`"
# Smart pane switching with awareness of Vim splits and fzf.
# See: https://github.com/christoomey/vim-tmux-navigator
not_tmux="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)$'"
bind-key -n C-h if-shell "$not_tmux" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$not_tmux" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$not_tmux" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$not_tmux" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$not_tmux" "send-keys C-\\" "select-pane -l"
# switching between zoomed windows
bind -r Tab select-pane -t .+1 \; resize-pane -Z
# don't hang around for the escape key
set -sg escape-time 0
# vim:fdm=marker et fdl=2 sts=2 sw=2 ts=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment