Open lovesegfault opened 3 years ago
You can use this:
local function check_snippet()
if require("snippets").has_active_snippet() then
return true
end
local _, snippet = require("snippets").lookup_snippet_at_cursor()
return snippet ~= nil
end
Unfortunately snippets.nvim
doesn't expose a public function to check whether or not a snippet expansion would occur, but the function above does effectively that.
For the <S-Tab>
portion, you can just use require("snippets").has_active_snippet()
.
Currently
nvim-compe
has an example of how it can be used with vsnip:Is there an easy easy way to use
snippets.nvim
here? I'm especially unsure of what the equivalent tovsnip#available
is.Thanks!