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 15 | #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 set -g status off |
install xclip
1 | apt install xclip |
Common commands,
1 2 3 4 5 6 | c open new window
w window list
" split window up and down
% split window left and right
[ copy mode, 'q' to exit
d hang up tmux, 'tmux attach' to return |
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/