From 68668f1d2b5abbff33c50dc8a4806d575bb79afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 15 Nov 2023 13:01:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(nvim):=20cmp=20new=20sources?= =?UTF-8?q?=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/cmp.lua | 45 +++++++------------------------- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d42a3df3..7fb683ab 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -14,6 +14,7 @@ "ccc.nvim": { "branch": "main", "commit": "f77b477d9f0b9a28612212b3fc43145f2a5591cc" }, "cinnamon.nvim": { "branch": "master", "commit": "c406ffda3a0302f32c23b24ab756ea20467d6578" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index c135e9df..0ab77f09 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -10,47 +10,20 @@ return { { "amarakon/nvim-cmp-fonts", }, + { + "hrsh7th/cmp-emoji", + }, }, keys = { { "ciC", ":CmpStatus", desc = "Cmp Status" }, }, opts = function(_, opts) - -- TODO: Fix this comments - -- cmp.setup.filetype("gitcommit", { - -- sources = cmp.config.sources({ - -- { name = "git" }, - -- }), - -- }) - -- - -- cmp.setup.filetype("css", { - -- sources = cmp.config.sources({ - -- { name = "nvim_lsp" }, - -- { name = "luasnip" }, - -- { name = "path" }, - -- }, { - -- { name = "buffer" }, - -- { name = "fonts", option = { space_filter = "-" } }, - -- }), - -- }) - -- - -- -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - -- cmp.setup.cmdline({ "/", "?" }, { - -- mapping = cmp.mapping.preset.cmdline(), - -- sources = { - -- { name = "buffer" }, - -- }, - -- }) - -- - -- -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - -- cmp.setup.cmdline(":", { - -- mapping = cmp.mapping.preset.cmdline(), - -- sources = cmp.config.sources({ - -- { name = "path" }, - -- }, { - -- { name = "cmdline" }, - -- }), - -- }) - + opts.sources = cmp.config.sources( + vim.list_extend( + opts.sources, + { { name = "emoji" }, { name = "git" }, { name = "fonts", option = { space_filter = "-" } } } + ) + ) opts.mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),