init.lua/after/plugin/cmp.lua
2024-02-11 18:40:21 +05:30

30 lines
573 B
Lua

require("cmp_git").setup()
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
formatting = {
format = require("lspkind").cmp_format({
mode = "symbol_text",
}),
},
})
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "git" },
}, {
{ name = "buffer" },
}),
})