nixos-configs/common/home/neovim/langs/csharp.nix
matt1432 d311d5de3c
All checks were successful
Discord / discord commits (push) Has been skipped
feat(nvim): add csharp config
2024-10-05 15:17:16 -04:00

44 lines
1.1 KiB
Nix

{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde;
in
mkIf neovimIde {
programs = {
neovim = {
extraPackages = builtins.attrValues {
inherit
(pkgs)
csharp-ls
;
};
extraLuaConfig =
# lua
''
vim.api.nvim_create_autocmd('FileType', {
pattern = {'cs'},
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
local csharpls_extended = require('csharpls_extended');
require('lspconfig').csharp_ls.setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
handlers = {
["textDocument/definition"] = csharpls_extended.handler,
["textDocument/typeDefinition"] = csharpls_extended.handler,
},
});
'';
plugins = builtins.attrValues {
inherit (pkgs.vimPlugins) csharpls-extended-lsp-nvim;
};
};
};
}