fix(nvim): cmp config

This commit is contained in:
Rob Watson 2023-10-01 08:10:27 +02:00
parent 8f9a26b5ce
commit 5762d37163
1 changed files with 7 additions and 1 deletions

View File

@ -1,9 +1,15 @@
local cmp = require("cmp")
-- local cmp_buffer = require("cmp_buffer")
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
completion = {
completeopt = "menu,menuone,noselect",
completeopt = "menu,menuone,noinsert,noselect",
},
snippet = {
expand = function(args)