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 = [
./languages.nix
./themes/tokyonight.nix
];
programs.helix = {
enable = true;
defaultEditor = true;

View file

@ -3,11 +3,13 @@
lib,
...
}: {
home.packages = [(pkgs.callPackage ../../../../pkgs/scls {})];
programs.helix.languages = {
language = with pkgs; [
{
name = "nix";
auto-format = true;
language-servers = ["scls" "nil"];
formatter = {
command = lib.getExe alejandra;
args = ["-q"];
@ -16,9 +18,7 @@
{
name = "rust";
auto-format = true;
language-servers = [
"rust-analyzer"
];
language-servers = ["scls" "rust-analyzer"];
formatter = {
command = lib.getExe rustfmt;
args = ["--edition" "2021"];
@ -27,12 +27,62 @@
{
name = "lua";
auto-format = true;
language-servers = ["scls" "lua-language-server"];
formatter = {
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; {
scls = {
command = "simple-completion-language-server";
config = {
feature_snippets = true;
feature_paths = true;
};
};
nil = {
command = lib.getExe nil;
};
@ -44,6 +94,17 @@
command = "${typescript-language-server}/bin/typescript-language-server";
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 = {
checkOnSave.command = "clippy";
inlayHints = {