LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

Override default

Open leiserfg opened this issue 1 year ago • 3 comments

Hi @L3MON4D3 I saw this in @tjdevries config, should we upstream it? (In that case it will be the first real "push requests" in history 😄 )

https://github.com/tjdevries/config.nvim/blob/c16bab0565253f862da0cef6a288399640b3c567/lua/custom/snippets.lua#L41

leiserfg avatar Jul 17 '24 21:07 leiserfg

override_builtin doesn't mean anything to me, am I missing something? :sweat_smile: (I'm assuming I am, please educate me :D)

L3MON4D3 avatar Jul 20 '24 21:07 L3MON4D3

That single line is incorrect, but the rest of the file is replacing the built-in snippets of vim. So my guess is that that's the API @tjdevries was expecting for that same usecase.

leiserfg avatar Jul 21 '24 06:07 leiserfg

Ahh I see.. Yeah that seems like a good idea, quickly swap out snippet engines, and hooking vim.*-functions is very well-known. I like it :)

I'd like to mention that implementing this as a simple api-function would work as well, but is probably more cumbersome for the user (setting .setup({...})-values can be done in the lazy-configuration directly)

L3MON4D3 avatar Jul 21 '24 13:07 L3MON4D3