chrisgrieser / nvim-scissors

Automagical editing and creation of snippets.
MIT License
347 stars 3 forks source link

Feature Request: Support project scope snippet #19

Open ofseed opened 1 month ago

ofseed commented 1 month ago

Feature Requested

Thank you for making such a convenient plugin to create snippets, this encouraged me a lot to use snippets and made I code faster!

I think it could be nicer. Since we are easy to create snippets by leveraging this plugin, I wish it could support project scope snippets, in other words, create snippets in .vscode/<name>.code-snippets, and mark scope of the new snippets to the filetype of the current editing file.

Relevant Screenshot

Reference: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_project-snippet-scope

Checklist

chrisgrieser commented 1 month ago

Project-scoped snippets would indeed be nice, however, adding support for them to nvim-scissors would be in vain, since to my knowledge, there is no snippet engine plugin that uses them. There is no point in creating project snippets if there is no way to use them.

Please create feature requests at snippet engine plugins like nvim-snippets. As soon as there is a supporting snippet engine, this issue can be re-opened.

ofseed commented 1 month ago

It's supported in luasnip, see https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#standalone.

While luasnip did not support automatically loading it, writing an autocmd of DirChange to load it is not that hard. The most important feature to support it is to support the scope key, which luasnip implemented.

chrisgrieser commented 1 month ago

Oh, didn't know that luasnip supports it, my bad

chrisgrieser commented 1 month ago

I created a FR at nvim-snippets: https://github.com/garymjr/nvim-snippets/issues/53