From a568a964fd6a9efba388b2b4919339c0b7dfe51d Mon Sep 17 00:00:00 2001 From: venomade Date: Mon, 16 Feb 2026 17:31:16 +0000 Subject: MacOS Nix Asahi is just not perfectly usable yet. Moved stuff, went nix. --- config/nvim/lua/plugins/cmp.lua | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 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..69a2396 --- /dev/null +++ b/config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,99 @@ +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 = cmp.PreselectMode.None, + completion = { + completeopt = "menu,menuone,noinsert", + callSnippet = "Replace", + keywordSnippet = "Replace", + }, + 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.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.abort(), + }), + 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', { + -- cmd = { '/home/venomade/.local/share/lua-language-server/bin/lua-language-server' }, + capabilities = capabilities, + root_markers = { + ".luarc.json", + ".luarc.jsonc", + ".git", + }, + settings = { + Lua = { + runtime = { + version = 'Lua 5.4', + path = vim.list_extend( + vim.split(package.path, ';'), + { + '?.lua', + '?/init.lua', + './stubs/?.lua', + './stubs/?/init.lua' + }), + }, + workspace = { + library = { + vim.env.HOME .. '/.luarocks/share/lua/5.4', + './stubs' + }, + }, + diagnostics = { + enable = true, + }, + }, + }, + }) + + vim.lsp.enable('lua_ls') + vim.lsp.config('clangd', { + capabilities = capabilities + }) + vim.lsp.enable('clangd') + end +} -- cgit 1.4.1-2-gfad0