helix: update languages

This commit is contained in:
notohh 2024-05-27 12:07:19 -04:00
parent ccc72814df
commit 520f10436e
Signed by: notohh
GPG key ID: BD47506D475EE86D
2 changed files with 66 additions and 4 deletions

View file

@ -1,8 +1,9 @@
{...}: { _: {
imports = [ imports = [
./languages.nix ./languages.nix
./themes/tokyonight.nix ./themes/tokyonight.nix
]; ];
programs.helix = { programs.helix = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;

View file

@ -3,11 +3,13 @@
lib, lib,
... ...
}: { }: {
home.packages = [(pkgs.callPackage ../../../../pkgs/scls {})];
programs.helix.languages = { programs.helix.languages = {
language = with pkgs; [ language = with pkgs; [
{ {
name = "nix"; name = "nix";
auto-format = true; auto-format = true;
language-servers = ["scls" "nil"];
formatter = { formatter = {
command = lib.getExe alejandra; command = lib.getExe alejandra;
args = ["-q"]; args = ["-q"];
@ -16,9 +18,7 @@
{ {
name = "rust"; name = "rust";
auto-format = true; auto-format = true;
language-servers = [ language-servers = ["scls" "rust-analyzer"];
"rust-analyzer"
];
formatter = { formatter = {
command = lib.getExe rustfmt; command = lib.getExe rustfmt;
args = ["--edition" "2021"]; args = ["--edition" "2021"];
@ -27,12 +27,62 @@
{ {
name = "lua"; name = "lua";
auto-format = true; auto-format = true;
language-servers = ["scls" "lua-language-server"];
formatter = { formatter = {
command = lib.getExe stylua; command = lib.getExe stylua;
}; };
} }
{
name = "python";
auto-format = true;
language-servers = ["scls" "ruff"];
formatter = with pkgs; {
command = lib.getExe ruff;
args = ["format" "-q"];
};
}
{
name = "javascript";
auto-format = true;
language-servers = [
"scls"
{
name = "typescript-language-server";
except-features = ["format"];
}
];
formatter = with pkgs; {
command = lib.getExe biome;
args = ["format"];
};
}
{
name = "toml";
auto-format = true;
language-servers = ["scls" "taplo"];
formatter = with pkgs; {
command = lib.getExe taplo;
args = ["fmt" "-"];
};
}
{
name = "json";
auto-format = true;
language-servers = ["scls" "biome"];
formatter = with pkgs; {
command = lib.getExe biome;
args = ["format"];
};
}
]; ];
language-server = with pkgs; { language-server = with pkgs; {
scls = {
command = "simple-completion-language-server";
config = {
feature_snippets = true;
feature_paths = true;
};
};
nil = { nil = {
command = lib.getExe nil; command = lib.getExe nil;
}; };
@ -44,6 +94,17 @@
command = "${typescript-language-server}/bin/typescript-language-server"; command = "${typescript-language-server}/bin/typescript-language-server";
args = ["--stdio"]; args = ["--stdio"];
}; };
lua = {
command = lib.getExe lua-language-server;
};
taplo = {
command = lib.getExe taplo;
args = ["lsp" "stdio"];
};
ruff = {
command = lib.getExe ruff;
args = ["server" "--preview"];
};
rust-analyzer.config = { rust-analyzer.config = {
checkOnSave.command = "clippy"; checkOnSave.command = "clippy";
inlayHints = { inlayHints = {