Skip to content

Instantly share code, notes, and snippets.

@hnq90
Last active December 29, 2016 07:08
Show Gist options
  • Select an option

  • Save hnq90/318ddc298c61ea2b0b7b8b46df06fe7a to your computer and use it in GitHub Desktop.

Select an option

Save hnq90/318ddc298c61ea2b0b7b8b46df06fe7a to your computer and use it in GitHub Desktop.
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# solve the arrows mess when using vim in tmux
set -g default-terminal "xterm-256color"
# use mouse to scroll the output page instead of the command history
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# reload the file using Prefix-r
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded!"
# Switch pane, default is with -r (repeated without prefix)
bind Up select-pane -U
bind k select-pane -U
bind Down select-pane -D
bind j select-pane -D
bind Left select-pane -L
bind h select-pane -L
bind Right select-pane -R
bind l select-pane -R
# C-a t to kill-pane
bind -r t kill-pane
# Kill all other panes but the current one
bind T confirm-before "kill-pane -a"
# Kill current window
# bind -r x kill-window
# Kill all the other windows but the current one
bind X confirm-before "kill-window -a"
# Start Window Numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# Aggressive resize(don't know what this means)
setw -g aggressive-resize on
# Vertial split-window from current dir
bind -r v split-window -h -c "#{pane_current_path}"
bind -r \ split-window -h -c "#{pane_current_path}"
# Horizontal split-window from current dir
bind -r h split-window -c "#{pane_current_path}"
bind -r - split-window -c "#{pane_current_path}"
# Create new window #from the current dir
bind c new-window -c "#{pane_current_path}"
# Copy/Paste between system clipboard and tmux
set -g mouse on
# Toggle mouse on/off
bind m set -g mouse
# Scrollback limit
set -g history-limit 30000
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# Automatically set window title to reflect the current program
setw -g automatic-rename on
# Disable C-z to suspend tmux
unbind-key C-z
# Disable C-d to exit shell, this C-d happens when being first input to prompt
unbind-key C-d
# Rename your terminals
set -g set-titles on
set -g set-titles-string '#(whoami)::#h'
# Status bar customization
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 120
set -g status-left "#[fg=Green]#(whoami)#[fg=white]@#[fg=blue]#(hostname -s)#[fg=white] | ##[fg=yellow]"
set -g status-justify left
set -g status-right '#{prefix_highlight} Online: #{online_status} | #(tmux-mem-cpu-load -i 5) | Session: #[fg=Cyan]#S | #[fg=white]%a %d %b %R'
# Highlight active window
setw -g window-status-current-fg red
set -g pane-active-border-fg red
# Identify activity in other windows
setw -g monitor-activity on
set -g visual-activity on
setw -g window-status-current-attr bright
setw -g window-status-activity-attr bold,blink,underscore
setw -g window-status-format "[#I#([ #{window_panes} -gt 1 ] && echo :#{window_panes})]:#{pane_current_command}#F"
bind s list-panes -a -F '#S:#I:#P-#{pane_height}x#{pane_width} "#{pane_title}" #{history_size}'
set -g message-fg red
set -g message-bg default
set -g message-attr bright
set -g display-time 3000
# Retrieve persisted tmux after restart
# https://github.com/tmux-plugins/tmux-resurrect
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Automaticually saves tmux session every 15mins
# https://github.com/tmux-plugins/tmux-continuum
set -g @continuum-restore 'on'
# Allow copy and paste from tmux
# https://github.com/tmux-plugins/tmux-yank
set -g @plugin 'tmux-plugins/tmux-yank'
# tmux-copycat
set -g @plugin 'tmux-plugins/tmux-copycat'
# tmux-fpp
set -g @plugin 'jbnicolai/tmux-fpp'
# tmux-open
set -g @plugin 'tmux-plugins/tmux-open'
# tmux-online-status
set -g @plugin 'tmux-plugins/tmux-online-status'
# tmux-cpu
# set -g @plugin 'tmux-plugins/tmux-cpu'
# tmux-mem-cpu-load
set -g @plugin 'thewtex/tmux-mem-cpu-load'
# tmux-highlight prefix
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# 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