Closed sQVe closed 4 months ago
Second this. Just mapping <Tab>
worked for me yesterday, but it no longer works.
As of the last PR, something like this should work btw:
require("supermaven-nvim").setup({
disable_keymaps = true
})
...
M.expand = function(fallback)
local luasnip = require('luasnip')
local suggestion = require('supermaven-nvim.completion_preview')
if luasnip.expandable() then
luasnip.expand()
elseif suggestion.has_suggestion() then
suggestion.on_accept_suggestion()
else
fallback()
end
end
Just in case this saves someone's time in the future, there is also expand_or_jumpable()
and expand_or_jump()
.
Closing issue since https://github.com/supermaven-inc/supermaven-nvim/issues/15#issuecomment-2119390970 provides a solution.
Hey,
I would love to be able to interact with this plugin via Lua code. This is super useful when configuring AI suggestions together with LSP completion.
This is how I set up accepting both Luasnip snippets and GitHub Copilot under the save key via
nvim-cmp
:Cheers!