mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-05 13:01:15 +00:00
33 lines
766 B
Nix
33 lines
766 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf mkMerge nvim optionalString mapAttrs;
|
|
|
|
cfg = config.vim.lsp;
|
|
in {
|
|
config = mkIf cfg.lspconfig.enable (mkMerge [
|
|
{
|
|
vim.lsp.enable = true;
|
|
|
|
vim.startPlugins = ["nvim-lspconfig"];
|
|
|
|
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] ''
|
|
local lspconfig = require('lspconfig')
|
|
|
|
${
|
|
# TODO: make border style configurable
|
|
optionalString (config.vim.ui.borders.enable) ''
|
|
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
|
|
''
|
|
}
|
|
'';
|
|
}
|
|
{
|
|
vim.luaConfigRC = mapAttrs (_: v: (nvim.dag.entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
|
|
}
|
|
]);
|
|
}
|