fix(nvim): cmp config
This commit is contained in:
parent
8f9a26b5ce
commit
5762d37163
|
@ -1,9 +1,15 @@
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
-- local cmp_buffer = require("cmp_buffer")
|
-- 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({
|
cmp.setup({
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone,noselect",
|
completeopt = "menu,menuone,noinsert,noselect",
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
|
Loading…
Reference in New Issue