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" }, event = { "BufRead package.json" },
opts = {}, opts = {},
}, },
{
"petertriho/cmp-git",
},
{
"amarakon/nvim-cmp-fonts",
},
}, },
opts = { opts = function(_, opts)
mapping = cmp.mapping.preset.insert({ 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-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), ["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.scroll_docs(-4), ["<C-p>"] = cmp.mapping.scroll_docs(-4),
@ -27,11 +44,11 @@ return {
cmp.abort() cmp.abort()
fallback() fallback()
end, end,
}), })
window = { opts.window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, }
}, end,
}, },
} }