chrisgrieser / nvim-scissors

Automagical editing and creation of snippets.
MIT License
377 stars 4 forks source link

Feature Request: multiple snippet directories #10

Closed nathanmsmith closed 9 months ago

nathanmsmith commented 9 months ago

Feature Requested

Could nvim-scissors support multiple snippet directories? I keep one "main" set of snippets in my dotfiles but I also have a separate set of work snippets that reference internal APIs and things that don't make sense for coding outside of my day job.

In LuaSnip, you can provide multiple paths to the paths option and this works great, e.g.,

require("luasnip.loaders.from_vscode").load({ paths = { "./main-snippets", "./work-snippets" } })

nvim-scissors right now seems to only designed for one snippet directory. Would it be possible to support reading/writing to multiple directories?

Relevant Screenshot

No response

Checklist

chrisgrieser commented 9 months ago

Wouldn't putting those two folders into one folder and using that folder as snippet directory work just as well?

nathanmsmith commented 9 months ago

My two folders are in separate git repos (don't want to expose private work stuff on public GitHub!) which is the recommended pattern at my company. I could totally copy or symlink files over into one folder but that seemed to add more complexity than adding in support for multiple directories to nvim-scissors, especially since this is a feature supported by LuaSnip.

If you'd prefer not to support this feature though that's totally fair!

chrisgrieser commented 9 months ago

Hmm. The issue is that Luasnip just needs to read the snippet files, whereas nvim-scissors needs to also write, search, bootstrap, and display snippets. While not a hard problem, supporting multiple snippet directories thus entails a bunch of changes in a lot of places.

Seeing that a symlink is in my view a clean solution leading to exactly the same end result, I don't think supporting multiple snippet directories is worth the effort. If there are issues that can only be solved by having multiple snippet directories, I am of course open to reconsider