Skip to content

Instantly share code, notes, and snippets.

@nikki93
Created July 21, 2022 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikki93/1ce64abc14fdaa30a2afccf66851a171 to your computer and use it in GitHub Desktop.
Save nikki93/1ce64abc14fdaa30a2afccf66851a171 to your computer and use it in GitHub Desktop.
# fix meta delay
set -sg escape-time 0
# allow differently sized terminals to look at different windows
setw -g aggressive-resize on
# 256 colors!
set -g default-terminal "screen-256color"
# use C-a for prefix
set -g prefix C-a
bind C-a send-prefix
# vim keys please!
set-window-option -g mode-keys vi
set-option -g status-keys vi
# start indices at 1 for easier selection
set -g base-index 1
setw -g pane-base-index 1
# `s`, `v` for splits
unbind %
bind v split-window -h
unbind '"'
bind s split-window -v
# movement
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
bind -n C-o display-panes
bind P swap-window -t -1
bind N swap-window -t +1
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
bind-key -n M-1 select-pane -t 1
bind-key -n M-2 select-pane -t 2
bind-key -n M-3 select-pane -t 3
bind-key -n M-4 select-pane -t 4
bind-key -n M-5 select-pane -t 5
bind-key -n M-6 select-pane -t 6
bind-key -n M-7 select-pane -t 7
bind-key -n M-8 select-pane -t 8
bind-key -n M-9 select-pane -t 9
# quit
bind q kill-session
# mac os x copypaste
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi 'Enter' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
set-option -g default-command "reattach-to-user-namespace -l zsh"
# environment variables to read per-session
set-option -g update-environment "VIM_SERVERNAME"
# window title
set-window-option -g automatic-rename on
# no clock
set -g status-right ''
# set window status from path
set-option -g status-interval 1
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# status style
set-option -g status-style "bg=default"
set-window-option -g status-left ""
set-window-option -g window-status-current-style "fg=#000000,bg=#dddddd"
set-window-option -g window-status-bell-style "fg=default,bg=red"
set-window-option -g window-status-activity-style "fg=#8ae234,bg=black"
set-window-option -g window-status-format '#I:#{=15:window_name}#F'
set-window-option -g window-status-current-format '#I:#W#F'
# selection style
set-window-option -g mode-style "bg=#808080"
# pane styles
set-option -g pane-border-style "fg=#808080"
set-option -g pane-active-border-style "fg=red"
set-option -g display-panes-colour black
set-option -g display-panes-active-colour red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment