diff --git a/lua/custom/plugins/supermaven.lua b/lua/custom/plugins/supermaven.lua index ff78ebc..481743b 100644 --- a/lua/custom/plugins/supermaven.lua +++ b/lua/custom/plugins/supermaven.lua @@ -1,10 +1,6 @@ return { "supermaven-inc/supermaven-nvim", - opts = { - keymaps = { - accept_suggestion = "", - clear_suggestion = "", - accept_word = "", - }, - }, + config = function() + require("custom.supermaven") + end } diff --git a/lua/custom/supermaven.lua b/lua/custom/supermaven.lua new file mode 100644 index 0000000..a390699 --- /dev/null +++ b/lua/custom/supermaven.lua @@ -0,0 +1,24 @@ +require("supermaven-nvim").setup({ + disable_keymaps = true, + disable_inline_completion = true, + log_level = "info", +}) + +-- Supermaven on-demand configuration +local suggestion = require('supermaven-nvim.completion_preview') + +local function on_demand_complete() + vim.g.supermaven_inline_completion_enabled = true + + vim.schedule(function() + if suggestion.has_suggestion() then + suggestion.on_accept_suggestion() + end + + vim.g.supermaven_inline_completion_enabled = false + end) + + return "" +end + +vim.keymap.set('i', '', on_demand_complete, { expr = true, silent = true, desc = "On-demand Supermaven completion" })