Sample Header Ad - 728x90

Use system clipboard in vi-copy mode in tmux

96 votes
10 answers
103034 views
I'm running tmux 1.6 and I'm trying to configure it to use vi-style keybindings as well as use the system clipboard when copying in interactive mode: set-window-option -g mode-keys vi bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy 'y' "copy-selection && run \"tmux save-buffer | xclip -selection clipboard\"" Simply put, I'd like to be able to do C+[ and then use v to begin selecting text for copying, then when y is pushed, copy the selection to the tmux selection and then export it to the system clipboard using xclip. Unfortunately, when I try to do this, I see the following: .tmux.conf: 14: unknown command: copy-selection && run "tmux save-buffer | xclip -selection clipboard" Is there a way to do this in tmux configuration?
Asked by Naftuli Kay (41346 rep)
May 19, 2014, 07:27 PM
Last activity: Mar 8, 2024, 03:41 PM