Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for snacks.nvim picker #33

Merged
merged 5 commits into from
Mar 12, 2025

Conversation

roycrippen4
Copy link
Contributor

Checklist

  • Used only camelCase variable names.
  • If functionality is added or modified, also made respective changes to the
    README.md (the .txt file is auto-generated and does not need to be modified).

Configuration

I chose not to expose snacks configuration options through the nvim-scissors config. It's possible to style the picker entirely through the snacks configuration. This information is mentioned in the README. I also chose not to implement the addSnippet function for snacks. Similar to dressing.nvim, snacks overrides vim.ui.select and can be modified through the snacks configuration.

Default snacks and nvim-scissors settings
2025-03-12-173414_hyprshot

Modified snacks settings w/ default nvim-scissors settings
2025-03-12-174747_hyprshot

Considerations

There is an edge case where a user could have both telescope and snacks installed. Right now telescope gets used since it's the first condition checked. It might make sense to add a configuration option to let the user pick their preferred picker. A simple string literal union of ---@type "telescope"|"snacks" would solve that issue.

Sorry, something went wrong.

@roycrippen4 roycrippen4 changed the title feat(Snacks.picker): Add support for snacks.nvim's picker Feature: Add support for snacks.nvim's picker Mar 12, 2025
@roycrippen4 roycrippen4 changed the title Feature: Add support for snacks.nvim's picker feat: Add support for snacks.nvim's picker Mar 12, 2025
@roycrippen4 roycrippen4 changed the title feat: Add support for snacks.nvim's picker feat: support for snacks.nvim picker Mar 12, 2025
@roycrippen4
Copy link
Contributor Author

Closes #32

@chrisgrieser
Copy link
Owner

chrisgrieser commented Mar 12, 2025

Thanks for the clean PR. Looks good to me.

Could you address the two failing checks? Apparently only markdown formatting and type annotation issues. Then I can merge.

@roycrippen4
Copy link
Contributor Author

roycrippen4 commented Mar 12, 2025

Just fixed the markdown issue. Snacks makes itself available through _G.Snacks which is part of why the type checking failed. Do you think using require("snacks").picker will fix the type checking?

roy.crippen4 added 3 commits March 12, 2025 18:37
Define fields that are used instead of merging with an existing `snacks` type
@chrisgrieser chrisgrieser merged commit 4181caa into chrisgrieser:main Mar 12, 2025
4 checks passed
@chrisgrieser
Copy link
Owner

Thx!

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.

None yet

2 participants