0

I can make a selection using Ctrl+Space like so:

enter image description here

but the problem is that I cannot find the keystroke to copy the selection to the clipboard. I tried this guide but both Ctrl+w and Alt+w did not seem to work.

I tried adding this to my ~/.tmux.conf:

bind -t vi-copy w copy-pipe "xclip -sel clip -i"

but I got this error when I ran source-file ~/.tmux.conf:

home/oleg/.tmux.conf:9: usage: bind-key [-cnr] [-T key-table] key command [arguments]

What is wrong? How to make it work?

0

1 Answer 1

1

What you're trying to use is old. The changelog states that in the version 2.4:

Key tables have undergone major changes. Mode key tables are no longer separate from the main key tables. All mode key tables have been removed, together with the -t flag to bind-key and unbind-key.

[…]

The emacs-copy and vi-copy tables have been replaced by the copy-mode and copy-mode-vi tables. Commands are sent using the -X and -N flags to send-keys.

Your command

bind -t vi-copy w copy-pipe "xclip -sel clip -i"

translates to

bind -T copy-mode-vi w send-keys -X copy-pipe "xclip -sel clip -i"

Note your question mentions Ctrl+w and Alt+w, but the command binds just w. Adjust if needed (use C-w or M-w instead of sole w).

1
  • 1
    @OlegzandrDenman Use C-w instead of sole w. Mar 9, 2020 at 22:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.