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
Other snippets plugins often show a quick snippet (ugh no pun intended) for how to "smart-map" <Tab> to either expand, jump to next slot, or insert a tab key (or ideally trigger completion).
Usually involving e.g. coc#expandableOrJumpable() for coc-snippets, or similar for vsnip, etc.
I'm sure there's likely a way to do so with snippets.nvim -- may be nice to have it in the README.
(Happy to send a PR if/when I figure out how to do so by jumping into the source).
The text was updated successfully, but these errors were encountered:
OK, I found snippets.lookup_snippet_at_cursor which meant I ended up with:
-- Expand a snippet if it exactly matches, otherwise complete.functiontab()
local_, expanded=snippets.lookup_snippet_at_cursor()
ifexpanded~=nilthensnippets.expand_at_cursor()
returnendcompletion.smart_tab()
end
which I'm sure is still slightly inefficient because it expands the snippet twice but does seem to do what I want personally.
Hi! (Thanks for making this!)
Other snippets plugins often show a quick snippet (ugh no pun intended) for how to "smart-map"
<Tab>
to either expand, jump to next slot, or insert a tab key (or ideally trigger completion).Usually involving e.g.
coc#expandableOrJumpable()
forcoc-snippets
, or similar for vsnip, etc.I'm sure there's likely a way to do so with
snippets.nvim
-- may be nice to have it in the README.(Happy to send a PR if/when I figure out how to do so by jumping into the source).
The text was updated successfully, but these errors were encountered: