mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-10 03:23:53 +00:00
110 lines
3.2 KiB
Nix
110 lines
3.2 KiB
Nix
|
{ pkgs, ... }:
|
||
|
let
|
||
|
indent = {
|
||
|
tab-width = 2;
|
||
|
unit = " ";
|
||
|
};
|
||
|
auto-format = true;
|
||
|
in {
|
||
|
programs.helix = with pkgs; {
|
||
|
languages = {
|
||
|
language = let prettier = nodePackages_latest.prettier;
|
||
|
in [
|
||
|
{ # NIX LSP
|
||
|
name = "nix";
|
||
|
language-servers = [ "nixd" ];
|
||
|
formatter.command = "${nixfmt-classic}/bin/nixfmt";
|
||
|
indent = indent;
|
||
|
inherit auto-format;
|
||
|
}
|
||
|
{ # FISH LSP
|
||
|
name = "fish";
|
||
|
language-servers = [ "fish_indent" ];
|
||
|
inherit auto-format;
|
||
|
formatter.command = "${fish}/bin/fish_indent";
|
||
|
indent = indent;
|
||
|
}
|
||
|
{ # HTML
|
||
|
name = "html";
|
||
|
language-servers = [ "vscode-html-language-server" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "html" ];
|
||
|
};
|
||
|
}
|
||
|
{ # JSON
|
||
|
name = "json";
|
||
|
language-servers = [ "vscode-json-language-server" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "json" ];
|
||
|
};
|
||
|
}
|
||
|
{ # JSON
|
||
|
name = "jsonc";
|
||
|
language-servers = [ "vscode-json-language-server" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "json" ];
|
||
|
};
|
||
|
}
|
||
|
{ # CSS
|
||
|
name = "css";
|
||
|
language-servers = [ "vscode-css-language-server" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "css" ];
|
||
|
};
|
||
|
}
|
||
|
{ # MARKDOWN
|
||
|
name = "markdown";
|
||
|
language-servers = [ "marksman" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "markdown" ];
|
||
|
};
|
||
|
}
|
||
|
{ # TYPESCRIP
|
||
|
name = "typescript";
|
||
|
language-servers = [ "typescript" ];
|
||
|
inherit auto-format;
|
||
|
formatter = {
|
||
|
command = "${prettier}/bin/prettier";
|
||
|
args = [ "--use-tabs" "--parser" "typescript" ];
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
language-server = let vscode = vscode-langservers-extracted;
|
||
|
in {
|
||
|
nixd = { command = "${nixd}/bin/nixd"; };
|
||
|
fish_indent = { command = "${fish}/bin/fish_indent"; };
|
||
|
vscode-html-language-server = {
|
||
|
command = "${vscode}/bin/vscode-html-language-server";
|
||
|
};
|
||
|
vscode-json-language-server = {
|
||
|
command = "${vscode}/bin/vscode-json-language-server";
|
||
|
};
|
||
|
vscode-css-language-server = {
|
||
|
command = "${vscode}/bin/vscode-css-language-server";
|
||
|
};
|
||
|
marksman = { command = "${marksman}/bin/marksman"; };
|
||
|
typescript = {
|
||
|
command =
|
||
|
"${typescript-language-server}/bin/typescript-language-server";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
extraPackages = with pkgs; [
|
||
|
# OTHER LSP
|
||
|
yaml-language-server
|
||
|
lua-language-server
|
||
|
taplo
|
||
|
];
|
||
|
};
|
||
|
}
|