From 1afa83cfcf5cf1f0af4ccac0c9589b4d4ddad0c8 Mon Sep 17 00:00:00 2001 From: Nicolai Van der Storm Date: Tue, 17 Oct 2023 13:34:53 +0200 Subject: [PATCH] base for lsp --- nix/users/base/neovim/default.nix | 17 ++++++++++++++++- nix/users/base/neovim/plugins/lsp.lua | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 nix/users/base/neovim/plugins/lsp.lua diff --git a/nix/users/base/neovim/default.nix b/nix/users/base/neovim/default.nix index 88e25c4..6309fb9 100644 --- a/nix/users/base/neovim/default.nix +++ b/nix/users/base/neovim/default.nix @@ -18,8 +18,23 @@ # Colorschemes { plugin = catppuccin-nvim; - config = toLuaFile ./plugins/colorschemes/catppuccin.lua + config = toLuaFile ./plugins/colorschemes/catppuccin.lua; } + + # LSP + { + plugin = vimPlugins.nvim-lspconfig; + config = toLuaFile ./plugins/lsp.lua; + } + + cmp-buffer + cmp-cmdline + cmp-nvim-lsp + cmp-nvim-lua + cmp-path + cmp_luasnip + luasnip + nvim-cmp ]; }; } diff --git a/nix/users/base/neovim/plugins/lsp.lua b/nix/users/base/neovim/plugins/lsp.lua new file mode 100644 index 0000000..a257596 --- /dev/null +++ b/nix/users/base/neovim/plugins/lsp.lua @@ -0,0 +1,22 @@ +-- safe imports +local status, cmp = pcall(require, "cmp") +if not status then + print("cmp not installed") + return +end +local status, luasnip = pcall(require, "luasnip") +if not status then + print("luasnip not installed") + return +end +local status, cmp_capabilities = pcall(require, "cmp_nvim_lsp") +if not status then + print("cmp_nvim_lsp not installed") + return +end +local status, lspconfig = pcall(require, "lspconfig") +if not status then + print("lspconfig not installed") + return +end +