Skip to content

Instantly share code, notes, and snippets.

@timothybasanov
Last active September 15, 2023 20:04
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timothybasanov/00f109853d73135749ccd4884312bcb0 to your computer and use it in GitHub Desktop.
Save timothybasanov/00f109853d73135749ccd4884312bcb0 to your computer and use it in GitHub Desktop.
byobu/tmux configuration
# https://github.com/dustinkirkland/byobu/commit/755c0e9f28b3f8ee57d9c7fc166f0bcbe96577db
# Fix pbcopy, subl and byobu help window:
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
# Should be done before the first session is created.
if-shell 'command -v reattach-to-user-namespace' 'set-option -g default-command "reattach-to-user-namespace -l ${SHELL}"'
# Tmux Plugin Manager (TPM) configuration section:
# 0) Update .tmux.conf with this configuration
# 1) git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# 2) ~/.tmux/plugins/tpm/bin/install_plugins
# 3) tmux kill-server
# Configure resurrect/continuum to save/restore automatically
# ^a^s to manually save and ^a^r to manually restore.
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
'
# Init TPM
# Should be done before the first session is created
if-shell 'test -x ~/.tmux/plugins/tpm/tpm' 'run ~/.tmux/plugins/tpm/tpm'
# Bind Ctrl-A prefix
unbind-key -n C-a
set -g prefix ^A
set -g prefix2 ^A
bind a send-prefix
# Enable mouse support
set -g mouse on
# Mouse (tmux) selection copy: Enter or c
# Requires tmux 2.4
unbind-key -T copy-mode-vi MouseDragEnd1Pane
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'command -v reattach-to-user-namespace >/dev/null && reattach-to-user-namespace pbcopy || pbcopy'
bind-key -T copy-mode-vi c send -X copy-pipe-and-cancel 'command -v reattach-to-user-namespace >/dev/null && reattach-to-user-namespace pbcopy || pbcopy'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment