LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

Using vscode snippets as fallback

Open premell opened this issue 2 years ago • 4 comments

It would be really nice if you could use both luasnippets and regular vscode snippets at the same time, so that it would prioritize the luasnippets and use the vscode ones as a fallback. The power of luasnip is amazing but because you have to give up all other snippets its kind of a chicken and egg problem. Since you have to create all new snippets for all langugaes in order to use lua, most people just default to the vscode snippets. There is a repo with luasnippets https://github.com/molleweide/LuaSnip-snippets.nvim, but it hasnt had much activity and I think a large reason for that is the high barrier of entry.

Anecdotally, I wanted to make a few cool snippets with lua, like being able to paste entire github plugin url in my config and having them being formatted for packer to install it. But for me to add this small snippet I'd have to give up all my other snippets.

Basically I think its necessary to have vscode as a fallback for the luasnip ecosystem to begin to grow.

I am sorry if there is an issue about this already, i couldnt find it. Btw thanks for the amazing plugin :)

premell avatar Mar 09 '23 21:03 premell

Goods news for you, you don't have to use a single loader, you can use all of them and also add your own snippets at the same time. This is not an issue.

leiserfg avatar Mar 09 '23 21:03 leiserfg

Huh then I am sorry, i tried looking at examples but couldnt find any case of people using both. Also this line from the documentation kinda made me think it was either one or the other image

Anyway, thanks for the help!

premell avatar Mar 09 '23 21:03 premell

I think that or could be changed to and/or to be more explicit we can do both, or only one of them

bew avatar Mar 09 '23 21:03 bew

Well, to be honest, it says or not xor :smile:

leiserfg avatar Mar 09 '23 22:03 leiserfg