Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add option to allow xclip -selection [pimary/secondary/clipboard] to be configured from .tmux.conf.local #349

Open
kting28 opened this issue May 8, 2020 · 5 comments

Comments

@kting28
Copy link

kting28 commented May 8, 2020

Hello, thanks for the wonderful tmux configurations! The only thing I really want is to able to configure the destination of xclip / xsel so that in linux user can use the middle mouse button to paste. By default the "clipboard" selection requires ctrl-v from GUI applications.

As a workaround I'm just rebinding them in user configuration, e.g.:

bind-key    -T copy-mode-vi Enter                send-keys -X copy-pipe-and-cancel "xclip -i -selection primary > /dev/null 2>&1"
bind-key    -T copy-mode-vi y                    send-keys -X copy-pipe-and-cancel "xclip -i -selection primary > /dev/null 2>&1"
bind-key    -T copy-mode-vi MouseDragEnd1Pane    send-keys -X copy-pipe-and-cancel "xclip -i -selection primary > /dev/null 2>&1"
@gpakosz
Copy link
Owner

gpakosz commented May 8, 2020

Hello @kting28 👋

If I understand correctly, you prefer to use XA_PRIMARY, i.e. pasting with the middle mouse button.

However in the bindings you gave above you're didn't change the binding for copy-mode-vi -y. Is it ton purpose?

@kting28
Copy link
Author

kting28 commented May 8, 2020

Oh thanks for the catch, it's a typo. I have updated the original snippet with what I have now. Basically explicitly use "-selection primary".
Ideally we can have a user controlled switch (primary/secondary/clipboard) and that can be used to update all the bindings. However I looked at how the current .tmux.conf is implemented and don't see a good clean way to do it. Hence asking here.
Btw, I gave up tmux multiple times before due to difficulty in configuring it and also the mouse-copy behavior. oh-my-tmux really helped me transition from screen and boost my productivity. Thanks again.

@gpakosz
Copy link
Owner

gpakosz commented May 8, 2020

I'm in the middle of many refactorings but I guess I can make the following happen

tmux_conf_copy_to_os_clipboard=true|false|primary|clipboard

Not sure when I'm ready to do it though

@kting28
Copy link
Author

kting28 commented May 8, 2020

Awesome!

@johnyoonh
Copy link

Another workaround is using yank plugin:
https://github.com/tmux-plugins/tmux-yank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants