Skip to content

Instantly share code, notes, and snippets.

@heiner
Created June 30, 2020 13:08
Show Gist options
  • Select an option

  • Save heiner/768bd903b02c0ae6b73b711d66a6b85d to your computer and use it in GitHub Desktop.

Select an option

Save heiner/768bd903b02c0ae6b73b711d66a6b85d to your computer and use it in GitHub Desktop.
# Essentials ###########################################################
unbind C-b
set -g prefix C-q
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Tmux configuration reloaded"
# Basic terminal defaults
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key -T copy-mode-vi 'M-w' send -X copy-selection
setw -g xterm-keys on
# Usability #############################################################
# Set mouse on by default
set -g mouse on
bind -T copy-mode-vi WheelUpPane send -X scroll-up
bind -T copy-mode-vi WheelDownPane send -X scroll-down
# Don't jump to bottom on mouse select
unbind -T copy-mode-vi MouseDragEnd1Pane
# But do put things into the clipboard on selection.
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Middle click to paste from the clipboard
bind-key -n MouseDown2Pane run "tmux paste-buffer"
# Easier targeting of panes
set -g base-index 1
# don't rename windows automatically
set -g allow-rename off
# Don't use bells, only visual
set -g monitor-activity on
set -g activity-action other
set -g bell-action none
set -g visual-bell off
# GUI ###################################################################
set -g status-position top
set -g status-right-length 50
# Left side of status bar
set -g status-left-bg black
set -g status-left-fg green
set -g status-left-length 40
set -g status-left "#[fg=cyan]#(whoami)#[fg=red]@#[fg=yellow]#H #[fg=white]| #[fg=green]#S #[fg=white]| #[fg=yellow]W#I #[fg=white]| #[fg=cyan]P#P"
# Right side of status bar
set -g status-right-bg black
set -g status-right-fg cyan
set -g status-right-length 40
# set -g status-right "#H #[fg=white]« #[fg=yellow]%H:%M:%S #[fg=green]%d-%b-%y"
set -g status-right ' #H'
set -g @prefix_highlight_show_copy_mode 'on'
# THEME #################################################################
# Basic status bar colors
set -g status-bg black
set -g status-fg cyan
# Window status
set -g window-status-format " [#I]#W#F "
set -g window-status-current-format " [#I]#W#F "
# Current window status
set -g window-status-current-bg cyan
set -g window-status-current-fg black
# Window with activity status
set -g window-status-activity-bg yellow # fg and bg are flipped here due to a
set -g window-status-activity-fg black # bug in tmux
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-bg default
set -g pane-border-fg default
# Active pane border
set -g pane-active-border-bg default
set -g pane-active-border-fg red
# Pane number indicator
set -g display-panes-colour default
set -g display-panes-active-colour default
# Clock mode
set -g clock-mode-colour red
set -g clock-mode-style 24
# Message
set -g message-bg default
set -g message-fg default
# Command message
set -g message-command-bg default
set -g message-command-fg default
# Mode
set -g mode-bg red
set -g mode-fg default
# END ###################################################################
# Additional plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-pain-control \
tmux-plugins/tmux-sessionist \
tmux-plugins/tmux-open \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-prefix-highlight \
tmux-plugins/tmux-cpu \
'
# Must be kept at the bottom of tmux.conf!
# Remember to do <prefix> + I to install the plugins!
run "~/.tmux/plugins/tpm/tpm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment