To have the vim-like, mouseless copy and paste in tmux, I have this snippet in my .tmux.conf.

setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection

Suppose I've selected my text of interest. Now, instead of copy-selection with y, I want to edit my selection and echo the edited version to a local file with g.

Trying to pipe the output of saveb to a shell command, I tried the following, but to no avail.

(forget about editing for now; just echoing)

bind-key g saveb - | run-shell 'xargs echo > ~/my-selection.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.