Open slacksystem opened 2 months ago
Adding new commands are unfortunately not supported. Only the ones already specified in commands.conf
can be customized.
However, adding support for custom commands is maybe something we should add. I guess many would want this (and maybe bind stuff from other plugins). That's actually a really good idea!
Just designing it quickly on top of my head, I'm thinking we should have a "template" CMD_$KT_CUSTOM_*
, where $KT
is an existing key table. Users can then add whatever they want, e.g. in your case
CMD_WIN_CUSTOM_SEARCH='tmux command-prompt -p "Search for:" "find-window -Zi %%"'
and correspondingly
KBD_WIN_CUSTOM_SEARCH='/'
This way we can identify and separate custom commands and their keybindings. Thanks for the idea! I'll see if I have time to cook something up this week.
Hi,
I have added the following to my
.tmux.conf
:in
~/.tmux/conf/keybindings.conf
, in addition to the defaults, I have addedand in
~/.tmux/conf/commands.conf
(context included to indicate position)
I've tried both
/
and'/'
as the values for KBD_WIN_SEARCH and neither seem to be bound. They don't do anything andlist-keys
doesn't have an entry for them. I've installed usingtpm
and when I addbind -T ktm-window '/' command-prompt -p "Search for:" "find-window -Zi %%"
belowrun '~/.tmux/plugins/tpm/tpm'
the keybind works, so there's a workaroubut otherwise it doesn't. I would think that any key that works withtmux bind-key
should work in the config file. Any ideas why this isn't working?