nvim-scissors icon indicating copy to clipboard operation
nvim-scissors copied to clipboard

Feature Request: Support project scope snippet

Open ofseed opened this issue 1 year ago • 5 comments

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

  • [X] The feature would be useful to more users than just me.

ofseed avatar Jul 31 '24 06:07 ofseed

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.

chrisgrieser avatar Jul 31 '24 07:07 chrisgrieser

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.

ofseed avatar Jul 31 '24 07:07 ofseed

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

chrisgrieser avatar Jul 31 '24 09:07 chrisgrieser

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

edit: and at blink.cmp: https://github.com/Saghen/blink.cmp/issues/197

chrisgrieser avatar Jul 31 '24 12:07 chrisgrieser

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, for example "bump", and it will be kept open.

github-actions[bot] avatar Apr 30 '25 04:04 github-actions[bot]

This issue has been closed due to inactivity, and will not be monitored.

github-actions[bot] avatar May 14 '25 04:05 github-actions[bot]