Skip to content

plugins: include descriptions and websites in 'plugin available' list - #4228

Open
gustavohnsv wants to merge 6 commits into
micro-editor:masterfrom
gustavohnsv:issue-4038
Open

gustavohnsv wants to merge 6 commits into
micro-editor:masterfrom
gustavohnsv:issue-4038

Conversation

@gustavohnsv

Copy link
Copy Markdown

Closes #4038

previously, running plugin available only listed plugin names:

bounce
zigfmt
joinLines
palettero

this PR updates plugin available to display the plugin's name, description, and website URL (when provided in repo.json):

bounce
    plugin to add nano-style 'smart home' and bounce cursor between matching brackets
    https://github.com/deusnefum/micro-bounce

zigfmt
    zig fmt on save and zig fmt --check linter support
    https://github.com/squeek502/micro-zigfmt

joinLines
    Plugin to join selected lines or join the following line with the current one
    https://github.com/Lisiadito/join-lines-plugin

palettero
    Command palette Ctrl-P - fuzzy search commands and textfilters
    https://terokarvinen.com/tags/micro-editor/

@gustavohnsv gustavohnsv changed the title include descriptions and websites in 'plugin available' list plugins: include descriptions and websites in 'plugin available' list Sep 18, 2026

@Andriamanitra Andriamanitra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change but a more compact format would be nicer. Maybe we could put the name and website on the same line?

There is also -plugin search which has similar but differently formatted output, it would be nice to make both output formats match.

Comment thread internal/config/plugin_installer.go Outdated
Comment on lines +731 to +735
separator := ""
fmt.Fprintln(out, "Available Plugins:")
for _, pkg := range packages {
fmt.Fprintln(out, pkg.Name)
fmt.Fprintf(out, separator)
separator = "\n\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would get rid of the unnecessary mutable variable:

Suggested change
separator := ""
fmt.Fprintln(out, "Available Plugins:")
for _, pkg := range packages {
fmt.Fprintln(out, pkg.Name)
fmt.Fprintf(out, separator)
separator = "\n\n"
fmt.Fprintln(out, "Available Plugins:")
for i, pkg := range packages {
if i > 0 {
fmt.Fprintf(out, "\n\n")
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, maybe use the loop variable is a better choice in this case

- add `printPluginList` helper to deduplicate output formatting
- standardize display format between `plugin search` and `plugin available`
- improve message when no plugins are found during search
@gustavohnsv

Copy link
Copy Markdown
Author

@Andriamanitra can you check if this approach are what you thinking? ignore my forced push

@Andriamanitra

Copy link
Copy Markdown
Collaborator

@gustavohnsv For sharing the output format between -plugin available and -plugin search, yes. But for the output format I meant something like this:

jlabbrev - https://github.com/MasFlam/jlabbrev
        Julia backslash abbreviations in micro

manipulator - https://github.com/NicolaiSoeborg/manipulator-plugin
        Plugin to do various kind of modifications to text in Micro

autofmt - https://github.com/a11ce/micro-autofmt
        plugin to run formatters on save

wc
        Plugin to count words/characters in micro

@gustavohnsv

Copy link
Copy Markdown
Author

sure, i think this layout is pretty nice, i put everything in one line 😅

- add comment above function for more information
@gustavohnsv

Copy link
Copy Markdown
Author

@Andriamanitra done?

Comment thread internal/config/plugin_installer.go Outdated
fmt.Fprintf(out, "\n")
}
if p.Website == "" {
fmt.Fprintf(out, "%s - No website found.\n\t%s\n", p.Name, p.Description)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "No website found." part feels unnecessary

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i put this because there are some plugins by default in micro without website reference, even if have a github page

micro plugin channel: https://github.com/micro-editor/plugin-channel/blob/master/channel.json
plugin without website reference example: https://raw.githubusercontent.com/micro-editor/updated-plugins/master/filemanager-plugin/repo.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if it's not there just leave out the website part, no need for a placeholder value IMO. It's an optional field so it's normal to not have one. "No website found." makes it sound like there was some kind of error when looking for it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense, i wasn't think that way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"plugin available" should list descriptions

2 participants