chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.53k stars 140 forks source link

Where to put new LUA scripts #157

Closed Ircama closed 3 years ago

Ircama commented 3 years ago

I implemented git_status.lua which adds some changes to the ex_async_prompt.lua LUA example in order to better manage git status with colored tracking information. What would be the best way to publish this?

Thanks

chrisant996 commented 3 years ago

Great question!

First, I'll respond to the specific options, and then I'll offer another option.

Also, here are two more options:

  1. There is a cmder-powerline-prompt repo with a sample prompt system. It's an updated fork of another repo. It can be used independently from Cmder, despite "cmder" in its name. It includes more sophisticated git prompt support.
  2. I'm working on a new clink-flex-prompt which is very similar to the powerlevel10k zsh prompt theme. It requires Clink v1.2.10 or higher. This new prompt system has many configuration options and makes it very easy to customize the prompt, generally without needing any Lua programming. There is not documentation yet (coming soon) but in the meantime hopefully the source code is readable. So far it has built in prompt modules for battery, cwd, duration, errorlevel, git, and user. It's easy to add new custom modules.
    • The clink-flex-prompt repo is a place where I could accept PRs for prompt script enhancements, and new modules.
bw1faeh0 commented 3 years ago

Maybe you can rename your clink-flex-prompt repo to something like clink-extensions and provide sub dirs for plugins, prompts, etc.?

chrisant996 commented 3 years ago

Maybe you can rename your clink-flex-prompt repo to something like clink-extensions and provide sub dirs for plugins, prompts, etc.?

clink-flex-prompt is a specific thing. Turning it into a collection of competing/incompatible scripts seems confusing. Also, I definitely do not want to be in the business of spending my time managing PRs for all kinds of unrelated things.

chrisant996 commented 3 years ago

clink-flex-prompt now works on v1.2.10 and higher. Clink v1.2.29 has been released with transient prompt support and some other goodies needed by clink-flex-prompt.

As for where to put Lua scripts, I don't want to manage a library of scripts. There's a lot of hidden cost in trying to do that. I may enable Discussions at some point, and that might sort of be a place where scripts can be shared. But probably it's better to share scripts by putting them in their own repos -- by the time there have been a couple updates to a script, a separate repo has a lot of benefits.

Destroy666x commented 2 years ago

@chrisant996 too bad such a great software has nice plugin support, but really poor visibility for them. E.g. I found clink-completions, very useful set of scripts, by complete accident. I'm wondering what else I'm missing. I don't think setting up a repo in "awesome" style, like "awesome-clink", containing references to other repos with plugins, would be something hard to manage, especially if people submitted PRs with their plugin links. I would create one myself, but I'm not really developing much on WIndows, so I barely know clink as of now and I have no clue what other good scripts may be hidden on GitHub or anywhere else.

pukkandan commented 2 years ago

For just discoverability, another idea that may help is to add a line in the README asking developers to add a specific tag in plugin repos. Something like clink-plugins. Then all the plugins that follow that instruction become easily searchable with https://github.com/topics/clink-plugins

ofc, this does not solve the other issue that each developer has to publish the plugin themselves. But since chris (understandably) don't want to maintain a repo with third-party scripts, I think this is a reasonable compromise

chrisant996 commented 2 years ago

Yup. I'm thinking about options, but it's complicated.

Ones available via Scoop are the most discoverable (if one uses Scoop, which I don't, really), and get auto-updated.

There is a section in the Clink docs with links to the "best" scripts I know of. Clink-completions and clink-flex-prompt are both listed there.

Destroy666x commented 2 years ago

I see, so not many recommendations as of now. GH tag is a quite good idea too.

chrisant996 commented 2 years ago

I've made a clink-gizmos repo with the best Clink scripts that I use.

It does not include [clink-completions](https://github.com/vladimir-kotikov/clink-completions] or clink-flex-prompt at this time. I will likely see about including the former, but the latter probably does not belong there (imagine if other prompt scripts were to be added -- they would be unlikely to coexist well).

This is not quite the same as a universal library of third party scripts, but it is at least a step in a useful direction.