This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/plugins/lsp/default.nix

33 lines
773 B
Nix

{ lib
, plugins
, nvim-lspconfig
, nlsp-settings-nvim
, lspsaga-nvim
, luasnip
, nvim-cmp
, cmp-nvim-lsp
, cmp-luasnip
, ...
}:
let
inherit (builtins) readFile;
lsp = [ nvim-lspconfig nlsp-settings-nvim lspsaga-nvim ];
snippets = [ luasnip ];
completions = [
nvim-cmp # Autocompletion
cmp-nvim-lsp # LSP source for nvim-cmp
cmp-luasnip # Snippets source for nvim-cmp
];
lspConfigServers = lib.toLua (lib.attrByPath [ "lspConfig" "servers" ] [ ] plugins);
lspSagaSettings = lib.toLua (lib.attrByPath [ "lspSaga" "settings" ] { } plugins);
in
{
luaConfig = (readFile (lib.substituteAll { src = ./lspconfig.lua; inherit lspConfigServers lspSagaSettings; }))
+ (readFile ./nvim-cmp.lua);
plugins = lsp
++ snippets
++ completions;
}