From 8d688d1107c46b6dfdcaf02fa5c9c4c8a4640e65 Mon Sep 17 00:00:00 2001 From: venomade Date: Sun, 18 Jan 2026 16:07:54 +0000 Subject: KDE & Emacs --- .config/nvim/lua/plugins/cmp.lua | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .config/nvim/lua/plugins/cmp.lua (limited to '.config/nvim/lua/plugins/cmp.lua') diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..79bf9ac --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,64 @@ +return { + 'hrsh7th/nvim-cmp', + dependencies = { + 'neovim/nvim-lspconfig', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'lukas-reineke/cmp-rg', + 'onsails/lspkind.nvim' + }, + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') + cmp.setup({ + preselect = 'none', + window = { + completion = cmp.config.window.bordered({}), + documentation = cmp.config.window.bordered({}), + }, + snippet = { + expand = function(arg) + vim.snippet.expand(arg.body) + end + }, + mapping = cmp.mapping.preset.insert({ + -- [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.confirm(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + }), + sources = cmp.config.sources( + { + { name = 'nvim_lsp' }, + }, + { + { name = 'path' }, + }, + { + { name = 'buffer' }, + { name = 'rg', keyword_length = 3 } + } + ), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol' + }) + }, + -- view = { + -- entries = 'native' + -- }, + }) + + local capabilities = require('cmp_nvim_lsp').default_capabilities() + vim.lsp.config('lua_ls', { + capabilities = capabilities + }) + vim.lsp.enable('lua_ls') + vim.lsp.config('clangd', { + capabilities = capabilities + }) + vim.lsp.enable('clangd') + end +} -- cgit 1.4.1-2-gfad0