friendly-snippets
friendly-snippets copied to clipboard
[Feature Request] uuid snippet
I just converted from CoC and honza/snippets but one little feature I really miss is the ability to have a random uuid generator snippet like honza's UltiSnips uuid snippet.
Is it possible to add to LuaSnip rather than UltiSnip?
For reference, I checked out TrevorS/uuid-nvim but I'd like to have it as a snippet available for cmp rather than a keybind for dx consistency if at all possible.
Ps, thanks to all the contributors for the amazing work that has been put into this project!
Have a look at this PR I opened recently: https://github.com/rafamadriz/friendly-snippets/pull/386. It just adds an UUIDv4 snippet in the global scope. Is this what you're looking for?
Yes! This is exactly what I was looking for!
After testing, it doesn't seem to work
That's strange, I use it like that with Neovim + nvim-cmp + LuaSnip without issues. Do other LSP builtin variables ([1], [2]) work for you (e.g. date snippet)? I'm not an expert, so there could be something wrong with the snippet, too :smile:
[1] https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables [2] https://github.com/L3MON4D3/LuaSnip/blob/2dbef19461198630b3d7c39f414d09fb07d1fdd2/lua/luasnip/util/_builtin_vars.lua
It's not even showing up for me as a snippet tbh. As for other variable snippets like date, they work as expected. I would assume it would work if it were available but for some reason it's not even showing up
I think the problem is that you use the main
branch of my fork. But the uuid snippet is in the branch feature/global-uuid
: https://github.com/ybc37/friendly-snippets/tree/feature/global-uuid
I guess something like that should work (can't test it right now):
dependencies {
-- [...]
{
"ybc37/friendly-snippets",
branch = "feature/global-uuid"
},
-- [...]
},
I hope the PR gets merged soon :)
Wow I'm dumb... lol sorry about that
It works perfectly now!