Skip to content

Instantly share code, notes, and snippets.

@graves
Created October 24, 2020 08:57
Show Gist options
  • Save graves/50fd9bec902ab1e3502f539e173d80d8 to your computer and use it in GitHub Desktop.
Save graves/50fd9bec902ab1e3502f539e173d80d8 to your computer and use it in GitHub Desktop.
# Use zsh
set-option -g default-shell /bin/zsh
set -g mouse on
# Window title
set-option -g set-titles on
# Faster escape
set -s escape-time 0
# It's 2013
set -g default-terminal "screen-256color"
# Resize panes with mouse
#set -g mouse-resize-pane on
# Use c-a as prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
bind-key a send-key C-a
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
bind e set -g synchronize-panes
# use hjkl for moving
# and HJKL for resizing
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
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
bind = select-layout even-vertical
# shortcut for closing windows and panes
unbind c
bind w new-window -a
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"
# use v and s for windows splits
unbind %
bind s split-window -v
bind v split-window -h
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
# setw -g aggressive-resize off
# Coloring everything
# default statusbar colors
set -g status-fg yellow
set -g status-bg black
set -g status-style default
# default window title colors
set -g window-status-style fg=yellow
set -g window-status-style bg=black
#set -g window-status-style dim
# active window title colors
set -g window-status-current-style fg=brightred
set -g window-status-current-style bg=default
set -g window-status-current-style bright
# pane border
set -g pane-border-style fg=brightgreen
set -g pane-active-border-style fg=brightgreen
# message text
set -g message-style fg=brightred
set -g message-style bg=black
# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
# statusbar
set -g status-interval 60
set -g status-left-length 40
set -g status-justify centre
set -g status-left "#[fg=green]#S"
set -g status-right "#[fg=cyan]%R #(~/bin/battery)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment