From 0c8bbde1918d5521b7b1a00a3d90e873fc00534a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 19 Oct 2023 13:26:23 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20new=20cmp=20sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit still working to bring more --- .config/nvim/lua/plugins/cmp.lua | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) 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, }, }