Skip to content

Instantly share code, notes, and snippets.

@originalsouth
Last active October 8, 2019 10:11
Show Gist options
  • Save originalsouth/5d6443f97b92c0064b126ac871153127 to your computer and use it in GitHub Desktop.
Save originalsouth/5d6443f97b92c0064b126ac871153127 to your computer and use it in GitHub Desktop.
My tmux configuration
#Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'pwittchen/tmux-plugin-ip'
#Generic
set -sg escape-time 0
set -g base-index 1
set -g pane-base-index 1
#24bit color support
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "tmux-256color"
#Status line colors
#set -g status
set -g status-bg "#1b1b1b"
set -g status-fg green
#Status bar config
set-option -s status-interval 0.5
set -g status-left "#S ➡ "
set -g status-right-length 100
set -g status-right '[ #{ip} | #{battery_percentage} | %a (%V;%j) %d-%b-%Y %H:%M:%S ]'
set -g window-status-format " #W[#I]#{?window_zoomed_flag,:Z,}"
setw -g window-status-current-format " #[bold]#W#[default][#I]#{?window_zoomed_flag,:Z,}"
#Nvim cursor support
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
#Mouse works as expected
set -g mouse on
#Visual
setw -g monitor-activity on
set -g visual-activity on
#We are Vim users
set -g mode-keys vi
#Know your history
set -g history-limit 10000
set-option -g history-limit 10000
#Easy-to-remember split pane commands
bind | split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
unbind '"'
unbind %
#Copy and paste support paste
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
#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 :+
#Resize panes with vim movement keys
bind -r H resize-pane -L 3
bind -r J resize-pane -D 3
bind -r K resize-pane -U 3
bind -r L resize-pane -R 3
#Easy reload
bind r source-file ~/.tmux.conf
#Use tmux plugin manager (end)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment