Skip to content

Instantly share code, notes, and snippets.

@kimmel
Last active December 4, 2016 07:37
Show Gist options
  • Save kimmel/5368035 to your computer and use it in GitHub Desktop.
Save kimmel/5368035 to your computer and use it in GitHub Desktop.
tmux configuration for butt instances.
# scroll history
set -g history-limit 40000
#
# mouse / keyboard
#
set -g mouse on
# scroll wheel history - https://github.com/tmux/tmux/issues/145
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Scroll half a page at a time
bind -temacs-copy WheelUpPane halfpage-up
bind -temacs-copy WheelDownPane halfpage-down
# reload config file
unbind r
bind r source-file ~/.tmux.conf \; display "Config file reloaded."
# better shortcuts for splits
unbind %
bind v split-window -v
unbind '"'
bind h split-window -h
#
# title
#
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
set -g set-titles on
set -g set-titles-string "#(tmux ls | awk -F: '{print $1}' | xargs | sed 's/\ / | /g')"
#
# visuals
#
# truecolor support
set -ga terminal-overrides ",xterm-256color:Tc"
#
# status bar
#
set -g status-fg white
set -g status-bg blue
set -g status-justify centre
# left
set -g status-left-length 20
set -g status-left '#[fg=green][#[fg=red]#S#[fg=green]]#[default]'
# right
set -g status-right '#[fg=orange][ %B %d %H:%M ]#[default]'
# tabs
set -g window-status-format '#I#F#W'
set -g window-status-current-format '#[fg=yellow](#I.#P#F#W)#[default]'
#set -g status-keys vi
set -g status-interval 1
set -g status-attr bright
# ------------------------------------------------
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# from https://mutelight.org/practical-tmux
#setw -g aggressive-resize on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment