diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 51260402..649ce93c 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -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({ [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), [""] = 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, }, }