Skip to content

Instantly share code, notes, and snippets.

@rosscooperman
Last active April 25, 2020 06:07
Show Gist options
  • Save rosscooperman/3f1011c91e564473e1f36cb40612f956 to your computer and use it in GitHub Desktop.
Save rosscooperman/3f1011c91e564473e1f36cb40612f956 to your computer and use it in GitHub Desktop.
# Set reload key to r
bind r source-file ~/.tmux.conf\; display-message 'reloaded config'
source-file ~/.tmux.statusline
# Set colors
set-option -g default-terminal "screen-256color"
# remap tmux leader to `
set -g prefix `
bind-key ` send-prefix
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
bind C-l send-keys 'C-l'
# turn on mouse mode to allow copy, pane selection, etc. with mouse
set -g mouse on
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v', Space, and 'y' to manage tmux selections
bind-key -T copy-mode-vi v send -X begin-selection
# bind-key -T vi-copy v begin-selection
bind-key -T copy-mode-vi Space send -X rectangle-toggle
# bind-key -T vi-copy Space rectangle-toggle
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -T vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
# unbind -t vi-copy Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#
# Clear the current pane AND clear the pane's history
bind C-k send-keys 'C-l'\; clear-history
# longer scrollback
set -g history-limit 100000
# allow hot-reloading of tmux conf
bind r source-file ~/.tmux.conf\; display-message 'reloaded config'
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-pain-control \
'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
# prevent window auto-renaming
set-option -g allow-rename off
# This tmux statusbar config was created by tmuxline.vim
# on Sun, 28 Jun 2015
set -g status-bg "colour237"
set -g message-command-fg "colour250"
set -g status-justify "left"
set -g status-left-length "100"
set -g status "on"
set -g pane-active-border-fg "colour65"
set -g message-bg "colour235"
set -g status-right-length "100"
set -g status-right-attr "none"
set -g message-fg "colour250"
set -g message-command-bg "colour235"
set -g status-attr "none"
set -g pane-border-fg "colour235"
set -g status-left-attr "none"
setw -g window-status-fg "colour250"
setw -g window-status-attr "none"
setw -g window-status-activity-bg "colour237"
setw -g window-status-activity-attr "none"
setw -g window-status-activity-fg "colour65"
setw -g window-status-separator ""
setw -g window-status-bg "colour237"
set -g status-left "#[fg=colour193,bg=colour65] #S #[fg=colour65,bg=colour237,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour7,bg=colour237,nobold,nounderscore,noitalics] #[fg=colour235,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour100,bg=colour235] %Y-%m-%d | %H:%M #[fg=colour65,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour193,bg=colour65] #h #[fg=colour7,bg=colour237,nobold,nounderscore,noitalics] #{battery_icon}"
setw -g window-status-format "#[fg=colour250,bg=colour237] #I |#[fg=colour250,bg=colour237] #W "
setw -g window-status-current-format "#[fg=colour237,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour250,bg=colour235] #I |#[fg=colour250,bg=colour235] #W #[fg=colour235,bg=colour237,nobold,nounderscore,noitalics]"
➜ ll ~/.tmux/plugins
total 0
drwxr-xr-x@ 9 ross staff 288B Aug 10 2017 tmux-battery
drwxr-xr-x@ 18 ross staff 576B Aug 10 2017 tmux-copycat
drwxr-xr-x@ 8 ross staff 256B Aug 10 2017 tmux-pain-control
drwxr-xr-x@ 7 ross staff 224B Aug 10 2017 tmux-sensible
drwxr-xr-x@ 12 ross staff 384B Aug 10 2017 tmux-yank
drwxr-xr-x@ 16 ross staff 512B Aug 10 2017 tpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment