Distributing an Executable with a Plugin?

I’ve managed to implement something like the vimux plugin from vim (200ish lines of vimscript) in kakoune in less than 20 lines of python. While it works for me to put that python script on my $PATH, if I wanted to share it with others it would be a little tedious to make people need to do that step. Does kakoune config let you execute scripts from a common place? Is there, or could there be a convention of commands searching $XDG_CONFIG_HOME/kak/bin, $XDG_CONFIG_HOME/kak/scripts, $XDG_CONFIG_HOME/kak/plugins/{plugin name}/bin?

There is no hard rule, but what I have seen been done mostly is to put the executable in the same folder as .kak, so you can access it using the script’s directory which is also what I did here. Since plugin managers clone the whole repo you can usually guarantee that the files will stay in the same folder. If installed manually, it is also easy enough to instruct the user to place them in the same location.

1 Like

This is a great example, thanks!

I think this would be a nice convention.
This is what I do: ( And what I would impose as a rule if I was dictator )

If the script can be used:

  • by other programs :arrow_right: ~/bin or equivalent
  • by other kakoune plugin :arrow_right: $XDG_CONFIG_HOME/kak/bin
  • only by a specific kakoune plugin :arrow_right: $XDG_CONFIG_HOME/kak/plugins/{plugin name}/bin
1 Like

I like this idea! I think I might make the order prefer the .../kak/{plugin}/bin , and maybe omit $XDG_CONFIG_HOME/kak/bin from the search path so that different plugins don’t have name collisions or ‘install’ different versions of common utils. While reducing repetition is good, I’ve grown to prefer preventing dependency collisions.