hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.78k stars 386 forks source link

Suggestion: Make `config.completion.completeopt` consistent with `vim.opt.completeopt` behavior #1459

Open ghost opened 1 year ago

ghost commented 1 year ago

First up, thanks for this great plugin!

As I understand it, cmp's completion mechanism and therefore its completeopt setting is independent from Neovim's. I have nothing against this, but it would be nice to be able to do:

completion = { completeopt = { "menuone", "noinsert" } },

This would make it truly consistent with the vim option, which can be specified as a string and a Lua table:

-- string
vim.opt.completeopt = "menuone,noinsert"

-- table
vim.opt.completeopt = { "menuone", "noinsert" }

It obviously makes no practical difference, just a QoL thing.

astier commented 1 year ago

I'm using currently

completion = {
  completeopt = table.concat(vim.opt.completeopt:get(), ","),
}

like discussed in #43 but would prefer your solution. Nothing major but seems to be more consistent and cleaner.