# apt install powerline
$ cat ~/.tmux.conf
source "/usr/share/powerline/bindings/tmux/powerline.conf"
set -g default-terminal "screen-256color"
set -g mouse on
set -g history-limit 500000
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# https://blog.jpalardy.com/posts/tmux-synchronized-panes/
bind C-x setw synchronize-panes
# Memos
# tmux list-keys | grep selection
# tmux show -wg mode-keys (must return vi, not emacs)
# For binding 'y' to copy and exiting selection mode
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
- Enter ‘copy mode’ by pressing
ctrl+bthen[ - Use the arrow keys to go to the position from where you want to start copying. Press
ctrl+spaceto start copying. - Use arrow keys to go to the end of text you want to copy. Press
alt+worctrl+wto copy into Tmux buffer. - Press
ctrl+bthen]to paste in a possibly different Tmux pane/window.
- Select with mouse what you want to copy
- Before release your left button, press
Ctrl+b - Press
ctrl+woralt+wto copy into Tmux buffer - Press
ctrl+bthen]to paste in another Tmux pane/window
$EDITOR must exists and be set to vim
In your ~/.bashrc, ~/.zshrc, ~/.otherrc:
export EDITOR="vim"
Install xclip:
$ sudo apt install xclip
Add this to your ~/.tmux.conf:
# For binding 'y' to copy and exiting selection mode
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
Then to copy/paste:
- Select with mouse what you want to copy
- Before release your left button, press
Ctrl+b - Press the
ybutton - press
ctrl+vin any other application
tmux list-keys | grep selection
tmux show -wg mode-keys # must return vi, not emacs