supermaven-inc / supermaven-nvim

The official Neovim plugin for Supermaven
https://supermaven.com/
MIT License
492 stars 22 forks source link

Trigger supermaven manually #76

Open seal opened 1 month ago

seal commented 1 month ago

I want supermaven to act independant of cmp, my problem is when trying to do this, I can't seem to get "Tab" to accept the suggestion.

image When supermaven is like this, when I try to accept my lsp's suggestion, e.g. and auto-import, it accepts cmp's suggestion instead via Ctrl + i

local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
local cmp_select = { behavior = cmp.SelectBehavior.Select }
local cmp_mappings = {
    ['<CR>'] = cmp.mapping.confirm({ select = false }),
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<C-f>'] = cmp_action.luasnip_jump_forward(),
    ['<C-b>'] = cmp_action.luasnip_jump_backward(),
    ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
    ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
    ['<C-i>'] = cmp.mapping.confirm({ select = true }),
    ['<C-u>'] = cmp.mapping.scroll_docs(-4),
    ['<C-d>'] = cmp.mapping.scroll_docs(4),
}

-- Remove Tab mappings
cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil
cmp.setup({
    mapping = cmp.mapping(cmp_mappings),
})

I want Ctrl + i to be me lsp, and tab to be accept super-maven

seal commented 1 month ago

I now realise my issue

supermaven forces itsself as a source on cmp

so when i press Ctrl+i to accept my lsp's current suggestion supermaven decides it takes priority over my lsp ( even if I have disabled key-maps )

I'm not sure how to fix this. I want to use my lsp over supermaven sometimes

If I try to do this

disable_inline_completion = true,

I can't see the suggestion

So my two options are: