1
Fork 0
dots/nvim/lua/plugins/completion.lua

35 lines
722 B
Lua
Raw Normal View History

2023-08-21 09:56:16 +00:00
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-path"
},
config = function()
local cmp = require("cmp")
cmp.setup {
mapping = cmp.mapping.preset.insert {
2023-08-30 02:00:57 +00:00
["<C-Y>"] = function(fallback)
2023-08-21 09:56:16 +00:00
if cmp.visible() then
cmp.confirm { select=true }
else
fallback()
end
end
},
sources = {
{ name = "nvim_lsp" },
{ name = "nvim_lua" },
{ name = "buffer" },
{ name = "path" }
},
experimental = {
native_menu = false,
ghost_text = { hl_group = "Comment" }
}
}
end
}