tmux copy to systemclipboard
This commit is contained in:
parent
5ce1ca4a42
commit
ac6d7a07ea
@ -170,15 +170,20 @@ bind -n M-Tab swap-pane -t '{left-of}'
|
||||
# Copy mode
|
||||
setw -g mode-keys vi
|
||||
bind v copy-mode
|
||||
bind -n M-V copy-mode
|
||||
bind -r p paste-buffer -p
|
||||
bind C-p choose-buffer
|
||||
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||
|
||||
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard"
|
||||
bind -T copy-mode-vi Y send-keys -X copy-selection-and-cancel
|
||||
|
||||
bind -r p run-shell "xclip -selection clipboard -o | tmux load-buffer -; tmux paste-buffer -p"
|
||||
bind -r P paste-buffer -p
|
||||
|
||||
|
||||
## Toggle selection
|
||||
bind -T copy-mode-vi v if -F '#{selection_active}' 'send-keys -X clear-selection' 'send-keys -X begin-selection'
|
||||
|
||||
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||
|
||||
bind -T copy-mode-vi Escape send-keys -X cancel
|
||||
bind -T copy-mode-vi C-c send-keys -X cancel
|
||||
|
||||
@ -137,7 +137,7 @@ alias gbuild='go build -o . ./...'
|
||||
|
||||
|
||||
# clipboard
|
||||
if [ "${OSTYPE}" == "linux-gnu"* ]; then
|
||||
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
||||
if [ -n "${DISPLAY}" ]; then
|
||||
alias copy='xclip -selection clipboard -i'
|
||||
alias paste='xclip -selection clipboard -o'
|
||||
@ -148,7 +148,7 @@ if [ "${OSTYPE}" == "linux-gnu"* ]; then
|
||||
elif [[ "${OSTYPE}" == "linux-android"* ]]; then
|
||||
alias copy='termux-clipboard-set'
|
||||
alias paste='termux-clipboard-get'
|
||||
elif [ "${OSTYPE}" == "darwin" ]; then
|
||||
elif [[ "${OSTYPE}" == "darwin" ]]; then
|
||||
alias copy='pbcopy'
|
||||
alias paste='pbpaste'
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user