Skip to content

Instantly share code, notes, and snippets.

@jeffgravitywell
Last active June 25, 2019 11:53
Show Gist options
  • Save jeffgravitywell/600a3a9435817d083118546823daca84 to your computer and use it in GitHub Desktop.
Save jeffgravitywell/600a3a9435817d083118546823daca84 to your computer and use it in GitHub Desktop.
my tmux.conf file
# remap prefix to Control + a
# set -g prefix C-a
# unbind C-b
# bind C-a send-prefix
# Prefix
unbind C-b
set -g prefix `
bind ` send-prefix
# to set up the normal window, type leader + : then "resize-pane -R 55"
# force a reload of the config file
# bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
set -g default-terminal "xterm-256color"
set-option -g history-limit 20000
# use vi style keybindings
setw -g mode-keys vi
# xterm-style function key sequences
setw -g xterm-keys on
# Mouse support ----------------------------------------------------------
set -g mouse on
bind-key -T copy-mode-vi WheelUpPane send -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -X scroll-down
# # Vi copypaste
setw -g mode-keys vi
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" \; display-message "highlighted selection copied to system clipboard"
# Easy-to-remember split pane commands
bind \ split-window -h -c '#{pane_current_path}' # vertical pane
bind - split-window -v -c '#{pane_current_path}' # horizontal pane
unbind '"'
unbind %
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Status bar -------------------------------------------------------------
set-option -g status on
set-option -g set-titles on
set -g status-interval 1
set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION DISPLAY"
set -g status-position bottom
set -g status-bg colour237
set -g status-fg colour137
set -g status-left '#[fg=colour197]#(~/bin/internet_info.sh) '
set -g status-right ' #(~/bin/battery.sh) #[fg=colour255,bg=colour241,bold] %a %m-%d #[fg=colour255,bg=colour241,bold] %H:%M:%S #[fg=colour065]#[bg=default] #H '
set -g status-right-length 100
set -g status-left-length 70
# for vim
set -g @resurrect-strategy-vim 'session'
# Plugins
# List of plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
soyuka/tmux-current-pane-hostname \
christoomey/vim-tmux-navigator \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-yank \
'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment