feat: nixvim refactor

This commit is contained in:
2024-06-10 17:17:13 +02:00
parent 0603bb1123
commit 93e5f439f4
40 changed files with 7806 additions and 559 deletions

View File

@@ -0,0 +1,60 @@
{ lib, config, ... }:
let
cfg = config.presets.languages.angular;
in
{
options.presets.languages.angular = {
enable = lib.mkEnableOption "Angular";
};
config = lib.mkIf cfg.enable {
plugins = {
lsp.enabledServers = [
{
name = "angularls";
extraOptions = {
cmd = [
"ngserver"
"--stdio"
"--tsProbeLocations"
""
"--ngProbeLocations"
""
];
on_new_config = {
__raw = ''
function(new_config, new_root_dir)
new_config.cmd = {
new_root_dir .. "/node_modules/@angular/language-server/bin/ngserver",
"--stdio",
"--tsProbeLocations",
new_root_dir .. "/node_modules",
"--ngProbeLocations",
new_root_dir .. "/node_modules",
}
end
'';
};
filetypes = [
"typescript"
"html"
"typescriptreact"
"typescript.tsx"
"angular"
"html.angular"
];
on_attach = {
__raw = ''
function(client, bufnr)
if vim.bo[bufnr].filetype == "html" then
vim.bo[bufnr].filetype = "angular"
end
end
'';
};
};
}
];
};
};
}