You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
He also provides a way to "delete" the special prefix character soon after accepting the snippet, but I feel like it is more of a hack and could easily break.
I tried experimenting on my own, but I don't think it is possibile to hijack the item itself to drop the prefix character, all I managed to do is prefixing the displayed label with the character itself
transform_items=function(a, items)
returnvim.iter(items)
:map(function(item)
item.label= (";%s"):format(item.label)
returnitemend)
:totable()
end
Note that I am not using luasnip as of now (as it is duplicating results) but the builtin snippet source, having friendly-snippets installed. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to display snippets only by prefixing them using ";", so far i've found someone who already dealt with that
He also provides a way to "delete" the special prefix character soon after accepting the snippet, but I feel like it is more of a hack and could easily break.
I tried experimenting on my own, but I don't think it is possibile to hijack the item itself to drop the prefix character, all I managed to do is prefixing the displayed label with the character itself
Note that I am not using luasnip as of now (as it is duplicating results) but the builtin snippet source, having friendly-snippets installed. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions