tmux-plugins / tpm

Tmux Plugin Manager
MIT License
11.9k stars 417 forks source link

Add command aliases #211

Open verschmelzen opened 3 years ago

verschmelzen commented 3 years ago

Added aliases with the same function as the bindings and the option @tpm-aliases to enable/disable them. In the current PR the option is on by default. Should this be changed to 'off' for the backward compatibility?

bruno- commented 3 years ago

I didn't know tmux had this feature! I wanted something like this for a long time. Too bad the manpage is so terse.

Here are a couple thoughts on this:

Naming

bruno- commented 3 years ago

I'm so much under the impression of what can be done with this tmux feature...

verschmelzen commented 3 years ago

@bruno- you have to dig for some stuff in the manual indeed)

I very much agree on all the points and have updated the PR accordingly. Vim/Neovim plugins are already following this logic. I believe it to be very convenient when plugins implement commands first and then leave it up to the user to implement Fzf / completion / static bindings / use default bindings / etc for the quick access to the features they provide. Few things to consider:

Please share any other requirements that need to be implemented.

bruno- commented 3 years ago

Thank you for making the changes, almost all of them are great.

So, I made a bunch of comments above while I was under the initial impression of what's possible with this feature. After sleeping on it for a couple days and looking at your changes I have some fresh thoughts.

Hopefully you are ok with this slow process? The impact of the changes we make here is big.

New thoughts:

Since command-alias is used first time here we need to make sure that the minimal tmux version is correct

If you can find tmux version when command-alias was introduced, I'd be ok bumping minimum required tmux version for tpm.

Thoughts related to commands, but not related for this PR:

verschmelzen commented 2 years ago

@bruno- agree with your point regarding command naming. Just think this should be opt-out feature in case someone might have their own meaning for these commands. Or make both tpm- prefixed commands and plain names (like :update), and make the plain names opt-out

EDIT: if we take a look at the vim plugin managers, i believe, they have their plugin name as prefixes as common practice. Maybe we could just explain to the user in the README that: hey, you can make the commands more convenient for yourself, if you wish, here is the snippet, put it in your tmux.conf