When customizing .tmux.conf
I often need to try the command on the fly so I want to copy commands from .tmux.conf
(being opened in editor) to the command prompt (<c-b> :
). I tried <c-b> ]
after the command prompt but it does not work.
-
doesn't ctrl-y work for you?– Volodymyr BoikoCommented Jan 30 at 18:54
Add a comment
|
1 Answer
It's probably not possible to do without using the system clipboard (which assumes you're running a window manage of some sort).
I have this in my .tmuxrc
:
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
This means when I hit Enter after selecting something in tmux, it's copied to the system clipboard.
Thereafter, in my terminal I can just hit CtrlShift+v to paste it into the terminal.
This should work for your use case, I think.
-
this works only if tmux is running on local server right? Commented Jan 15, 2023 at 12:20
-
no -- it assumes its running on your local workstation --- the
xclip
in particular, requires xwindows to also be running on that machine– BradCommented Jan 15, 2023 at 12:43