Skip to content

Automatically select first entry in insert mode but don't select first entry in command mode #1708

Answered by fitrh
ryanmsnyder asked this question in Q&A
Discussion options

You must be logged in to vote

Set different completion.completeopt for global setup and cmdline setup

local cmp = require('cmp')

cmp.setup({
  completion = {
    completeopt = 'menu,menuone',
  },
})


-- you can replace `:` with table for multiple mode, e.g. { ':', '/', '?' } 
-- which will affect both ex-mode and search mode command
cmp.setup.cmdline(':', {
  completion = {
    completeopt = 'menu,menuone,noselect',
  },
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ryanmsnyder
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