Powerline
# 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'
Cheat sheet
Buffer, copy/paste, ...
Tmux copy-paste - the defaults
- Enter ‘copy mode’ by pressing
ctrl+b
then[
- Use the arrow keys to go to the position from where you want to start copying. Press
ctrl+space
to start copying. - Use arrow keys to go to the end of text you want to copy. Press
alt+w
orctrl+w
to copy into Tmux buffer. - Press
ctrl+b
then]
to paste in a possibly different Tmux pane/window.
Copy-paste with mouse
- Select with mouse what you want to copy
- Before release your left button, press
Ctrl+b
- Press
ctrl+w
oralt+w
to copy into Tmux buffer - Press
ctrl+b
then]
to paste in another Tmux pane/window
Copy-paste with mouse to clipboard
$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
y
button - press
ctrl+v
in any other application
Memos
tmux list-keys | grep selection
tmux show -wg mode-keys # must return vi, not emacs