I assume this is common operation but can't find any information about this. When in copy mode (Ctrl+[) Is there a shortcut to copy the word under the cursor without manually creating the selection?

I've tried to switch to vi-mode and use yw but it doesn't look like it works (in fact, I'm not entirely sure what vi-mode does besides mapping the arrow keys to hjkl).

Any idea how to achieve this?

  • I know it does not answer your question but if you have a mouse with a wheel, double-clicking the word then middle-clicking will paste the word. Temporary work-around, of course. – user86969 Jul 4 '17 at 10:15

I assume you're talking about text mode? In that case, I don't think it exists with the default settings.

In mouse mode ("set-option -g mouse on"), double-click is mapped to select the word.

If you want to bind a new shortcut, you could do something like (in your .tmux.conf, or test it out via 'Ctrl-b :') :

bind-key -T copy-mode-vi C-y send-keys -X select-word

This will allow control-y to select the word. In this case you will still have to press [Enter] to copy the word and exit copy-mode. If you wanted to do the copy and exit as part of the selection, you can do something like:

bind-key -T copy-mode-vi C-y send-keys -X select-word \; send-keys -X copy-selection-and-cancel

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.