feat(nvim): new cmp sources

still working to bring more
This commit is contained in:
Sergio Laín 2023-10-19 13:26:23 +02:00
parent f60979981c
commit 0c8bbde191
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -9,9 +9,26 @@ return {
event = { "BufRead package.json" },
opts = {},
},
{
"petertriho/cmp-git",
},
{
"amarakon/nvim-cmp-fonts",
},
},
opts = {
mapping = cmp.mapping.preset.insert({
opts = function(_, opts)
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}),
})
cmp.setup.filetype("css", {
sources = cmp.config.sources({
{ name = "fonts", option = { space_filter = "-" } }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}),
})
opts.mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.scroll_docs(-4),
@ -27,11 +44,11 @@ return {
cmp.abort()
fallback()
end,
}),
window = {
})
opts.window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
},
}
end,
},
}