jaclu / tmux-menus

Tmux plugin, Popup menus to help with managing your environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binding function key or switching the default key binding off

Futurile opened this issue · comments

Instead of using a <Prefix> binding, I want to bind tmux-menus to F11. With the @menus_trigger you can't do this as it assumes the keytable. To get around this, I'm doing the following in my .tmux.conf:

bind-key -T root F11 run-shell /home/steve/.tmux/plugins/tmux-menus/items/main.sh

I'm using the tmux-pain-control plugin which comes with a default binding for <Prefix>\.

I then want to prevent tmux-menus from binding the \, but can't find any way to prevent it.

If I bind it to nothing (set -g @menus_trigger '') then the test in menus.tmux sets it to the default of \.

What I'm doing at the moment is letting it bind, and then unbinding it so that the other plugin can bind afterwards:

set -g @plugin 'jaclu/tmux-menus'
unbind-key "\\"
set -g @plugin 'tmux-plugins/tmux-pain-control'

This is fine, but a bit messy.

I wonder if it would be good to provide an option so that we don't bind the key. For example, in tmux-easy-motion we can set whether a bind is active (@easy-motion-default-key-bindings "on" or "off"). I could create the equivalent @menus-default-key-binding and in menus.tmux check to see if that is set before binding.

Think I have a solution, will test it a bit first, should be up later in the evening!

I just pushed a new version that should hopefully solve your troubles!
I added a separate variable for non-prefix triggers: @menus_root_trigger
The Readme should hopefully explain it fully, please let me know if you have any remaining issues!

Ouch Sublime Texts built in git tool fooled me, I just noticed that despite claiming success, it had not actually pushed the change, well fixed now

Yes confirmed on Tmux 3.2a, this works:

# provides some menus that are bound to <F11>. I Avoid this plugins default
# of <Prefix>\ because tmux-pain-control uses this binding
set -g @menus_without_prefix 1
set -g @menus_trigger F11

Thanks!

Nice to hear, thx for the idea, never thought about automating direct triggers before