It took a lot of googling to make a good tmux conf for myself, and to get cut and paste from the X clipboard in Ubuntu working. Here is the result of my research.

I like vi key bindings and ‘Ctrl-a’ as the tmux prefix.

  • ‘Ctrl-a space’ to enter copy/scroll mode
  • ‘v’ to start highlighting
  • ‘y’ to yank to tmux clipboard
  • ‘Ctrl-a p’ to paste from tmux clipboard  to console
  • ‘Ctrl-a Ctrl-p’ to paste from X clipboard to console (overwrites tmux clipboard)
  • ‘Ctrl-a Ctrl-y’ to copy tmux clipboard to X clipboard (need xclip: ‘sudo apt-get install xclip’)

~/.tmux.conf

set-window-option -g mode-keys vi
set-option -g prefix C-a

unbind [
bind Space copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection

# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
bind C-y run "tmux save-buffer - | xclip -i -selection clipboard"

set -g base-index 1

set -g status-bg black
set -g status-fg white
set -g status-left ""
set -g status-right "#[fg=green]#H"

set-window-option -g window-status-current-bg red
  • ss

    awesome!

© 2014 Adam Klein's Blog Suffusion theme by Sayontan Sinha, modified by Adam :)