Open verschmelzen opened 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:
tpm
because people may follow the pattern (copy - paste - tweak) from here. Let's be thoughtful about this.run-shell
commands, we'll:
commands
instead of command-aliases
. They are "aliases" (and not real commands) from the perspective of core tmux. But, from the perspective of the users they are just commands.Naming
tpm
would start with tpm-
? This could be a nice convention, but it's more to type, so I'm not sure about this.install_plugins
script would have install-plugins
commands. We can change script names if needed.I'm so much under the impression of what can be done with this tmux feature...
@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:
command-alias
is used first time here we need to make sure that the minimal tmux version is correctbindings
directory was renames to the commands
and the scripts in this directory renamed to the names of corresponding commands.Please share any other requirements that need to be implemented.
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:
tpm-
is short to type, but take for example a relatively popular tmux-resurrect plugin. Should resurrect commands be: resurrect-save
and resurrect-restore
? That looks ugly to me.tpm
commands should be named install-plugins
, update-plugins
and clean-plugins
.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
.
command-alias
variable is just an array. If you run tmux set -ag command-alias "foo=echo bar"
multiple times, it will show multiple times in the output of tmux show -g command-alias
. This is something we need to solve because we can expect the users to source their .tmux.conf
multiple times, and this will run tmux set -ag command-alias ...
each time.Thoughts related to commands, but not related for this PR:
tpm
.@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
Added aliases with the same function as the bindings and the option
@tpm-aliases
to enable/disable them. In the current PR the option ison
by default. Should this be changed to 'off' for the backward compatibility?