tmux config

Choose tmux because screen cmd has no function like C-b + z.

First, ensure tmux server is down by cmd

1
tmux ls

~/.tmux.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#for copying to sys clipboard
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
 
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
 
#general other stuff
set -g default-terminal "xterm-256color"
set-window-option -g mode-keys vi
#set -g mouse on

install xclip

1
apt install xclip

refer to:
https://unix.stackexchange.com/questions/131011/use-system-clipboard-in-vi-copy-mode-in-tmux
https://jdhao.github.io/2018/09/30/tmux_settings_for_vim_users/