Skip to content

Instantly share code, notes, and snippets.

@spencer-p
Created July 17, 2020 20:38
Show Gist options
  • Save spencer-p/0d006fad63e2f9625cf5fdf168b32b63 to your computer and use it in GitHub Desktop.
Save spencer-p/0d006fad63e2f9625cf5fdf168b32b63 to your computer and use it in GitHub Desktop.
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
set -g mouse on
set -g mode-keys vi
set -g history-limit 10000
# y and p as in vim
bind Escape copy-mode
unbind p
bind p paste-buffer
#bind -T copy-mode-vi 'v' send -X begin-selection
#bind -T copy-mode-vi 'y' send -X copy-selection
bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard > /dev/null';
bind -T copy-mode-vi 'Space' send -X halfpage-down
bind -T copy-mode-vi 'Bspace' send -X halfpage-up
# extra commands for interacting with the ICCCM clipboard
#bind C-c run "tmux show-buffer | xsel -i -b"
#bind C-v run "tmux set-buffer \"$(xsel -o -b)\"; tmux paste-buffer"
# easy-to-remember split pane commands
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# moving between windows with vim movement keys
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
#SAME stuff as before, without prefix command ^-^
bind-key -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R
bind-key -n M-H select-window -t :-
bind-key -n M-L select-window -t :+
# resize panes with vim movement keys
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 -r C-H resize-pane -L 1
bind -r C-J resize-pane -D 1
bind -r C-K resize-pane -U 1
bind -r C-L resize-pane -R 1
set -g status-bg default
set -g status-fg default
set -g status-right ''
set -g status-left ''
bind N set -g status-left ' #[fg=black]#[bg=brightcyan] #S #[fg=default]#[bg=default]'
bind C-N set -g status-left ''
set -g status-justify centre
set -g status-interval 0
# Highlighting the active window in status bar
setw -g window-status-current-style fg=default,bg=default
setw -g window-status-style bg=default,fg=white
#setw -g window-status-separator ''
setw -g window-status-format '#[bg=white]#[fg=black] #I #[bg=default]#[fg=default] #W '
setw -g window-status-current-format '#[fg=black,bold]#[bg=blue] #I #[fg=default]#[bg=default] #W '
setw -g window-status-bell-style hidden
setw -g window-status-activity-style hidden
#setw -g window-status-content-style hidden
set-option -g pane-active-border-style fg=blue
set-option -g pane-border-style fg=brightblack
bind R source-file ~/.tmux.conf \; display-message "config reloaded"
set -g set-titles on
set -g renumber-windows on
#Shh.
setw -g monitor-activity off
#setw -g monitor-content off
set -g visual-activity off
#set -g visual-bell off
#set -g visual-content off
#set -g visual-silence off
#setw -g bell-action none
#Timeouts
set -g display-time 1000
set -g display-panes-time 4000
#correct term
set -g default-terminal "tmux-256color"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment