Skip to content

Instantly share code, notes, and snippets.

@tsaavik
Created August 16, 2021 15:21
Show Gist options
  • Save tsaavik/89c13c29674ad7f611d98d692976049e to your computer and use it in GitHub Desktop.
Save tsaavik/89c13c29674ad7f611d98d692976049e to your computer and use it in GitHub Desktop.
tmux.conf
# Make things colorful
set -g default-terminal "screen-256color"
setw -g window-status-current-format '#[fg=white]#I:#{?window_zoomed_flag,#[fg=colour201]#W,#W}'
# Window title for Putty,xterm,etc
set -g set-titles on
set -g allow-rename on
# ctrl-b / sets window name to hostname -s
bind-key / send-keys "printf \"\\033k$(hostname -s)\\033\ \"" \; send-keys "Enter"
# Allows tmux to resize window to largest currently ATTACHED terminal
setw -g aggressive-resize on
#vi type keys, like / for search and np for next/previous
set-window-option -g mode-keys vi
# Additional split screen keys - and |
bind-key | split-window -h
bind-key - split-window -v
# move window order around with ctrl-b < or >
bind-key -r "<" swap-window -d -t -1\; select-window -t -1
bind-key -r ">" swap-window -d -t +1\; select-window -t +1
# Scrollback history size (2000 is default)
set-option -g history-limit 8000
# Cut and paste 32768 lines worth of Scrollback history into a file of your choosing with P
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
#toggle mouse on/off with ctrl-b ctrl-m
bind-key c-m set-option -g mouse \; display-message 'Mouse #{?mouse,on,off}'
#https://github.com/tmux-plugins/tmux-resurrect
run-shell ~/.tmux/tmux-resurrect/resurrect.tmux
set -g @resurrect-processes 'ssh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment