Skip to content

Commit

Permalink
Set completeopt
Browse files Browse the repository at this point in the history
Configure `vim.opt.completeopt` in `core/config` and let nvim-cmp inherit its
setting using `table.concat` [1].

[1] hrsh7th/nvim-cmp#43
  • Loading branch information
notfirefox committed Aug 28, 2024
1 parent d003eef commit d8ee1da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lua/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ vim.opt.listchars = "tab:>-"
-- popup menu height
vim.opt.pumheight = 10

-- complete options
vim.opt.completeopt = "menu,menuone,noinsert"

-- color column
vim.opt.colorcolumn = "80"

Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ return {
-- setup nvim-cmp
cmp.setup {
completion = {
completeopt = "menu,menuone,noinsert"
completeopt = table.concat(vim.opt.completeopt:get(), ",")
},
enabled = function()
local context = require("cmp.config.context")
Expand Down

0 comments on commit d8ee1da

Please sign in to comment.