Skip to content

Behaviour like ctrl+n #1199

Answered by fitrh
jan0sch asked this question in Q&A
Sep 27, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You can use cmp.visible()

["<C-n>"] = cmp.mapping({
    i = function()
        if cmp.visible() then -- pop-up menu is visible
            cmp.select_next_item()
        else
            cmp.complete() -- open the pop-up menu
        end
    end,
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jan0sch
Comment options

Answer selected by jan0sch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants