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

55 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2022-11-19 00:56:53 +03:00
{ lib
, plugins
, nvim-lspconfig
2022-11-10 00:01:34 +03:00
, nlsp-settings-nvim
2022-09-19 20:43:20 +03:00
, lspsaga-nvim
, luasnip
, nvim-cmp
, cmp-nvim-lsp
2022-11-01 11:23:55 +03:00
, cmp-luasnip
2023-06-09 14:37:25 +03:00
, cmp-tabby
2022-09-19 20:43:20 +03:00
, ...
}:
2022-09-16 23:42:53 +03:00
2022-09-19 20:43:20 +03:00
let
2023-06-09 14:37:25 +03:00
tabbymlEnable = lib.attrByPath [ "tabbyml" "enable" ] false plugins;
tabbymlDefaultSettings = {
host = "http://127.0.0.1:8080";
2023-06-09 15:31:58 +03:00
max_lines = 100;
2023-06-09 14:37:25 +03:00
};
tabbymlSettings = lib.toLua (lib.attrByPath [ "tabbyml" "settings" ] tabbymlDefaultSettings plugins);
2024-04-16 18:54:21 +03:00
tabbymlLuaConfig = lib.optionalString tabbymlEnable
2023-06-09 14:37:25 +03:00
(lib.readSubFile ./cmp-tabby.lua { inherit tabbymlSettings; });
2024-04-16 18:54:21 +03:00
cmpSources = lib.toLua (
[
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{ name = "orgmode"; }
]
++ lib.optional tabbymlEnable { name = "cmp_tabby"; }
);
2023-06-09 14:37:25 +03:00
cmpLuaConfig = lib.readSubFile ./nvim-cmp.lua { inherit cmpSources; };
lspconfigLuaConfig = lib.readSubFile ./lspconfig.lua
{ inherit lspConfigServers lspSagaSettings; };
2022-11-10 00:01:34 +03:00
lsp = [ nvim-lspconfig nlsp-settings-nvim lspsaga-nvim ];
2022-09-19 20:43:20 +03:00
snippets = [ luasnip ];
completions = [
2022-09-16 23:42:53 +03:00
nvim-cmp # Autocompletion
cmp-nvim-lsp # LSP source for nvim-cmp
2022-11-01 11:23:55 +03:00
cmp-luasnip # Snippets source for nvim-cmp
2024-04-16 18:54:21 +03:00
] ++ lib.optional tabbymlEnable cmp-tabby;
2022-11-19 00:56:53 +03:00
lspConfigServers = lib.toLua (lib.attrByPath [ "lspConfig" "servers" ] [ ] plugins);
lspSagaSettings = lib.toLua (lib.attrByPath [ "lspSaga" "settings" ] { } plugins);
2022-09-19 20:43:20 +03:00
in
{
2023-06-09 14:37:25 +03:00
luaConfig = lspconfigLuaConfig + tabbymlLuaConfig + cmpLuaConfig;
2022-09-19 20:43:20 +03:00
plugins = lsp
++ snippets
++ completions;
2022-09-16 09:59:25 +03:00
}