NixOS-Config/home-manager/package-configs/helix.nix

89 lines
1.9 KiB
Nix
Raw Normal View History

2024-04-27 14:40:15 +02:00
{
config,
2024-04-27 14:55:46 +02:00
lib,
2024-04-27 14:40:15 +02:00
pkgs,
...
}: {
programs.helix = {
enable = true;
2024-04-27 14:55:46 +02:00
defaultEditor = true;
settings = {
theme = "catppuccin_macchiato";
editor = {
line-number = "relative";
lsp.display-messages = true;
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
cursorline = true;
bufferline = "always";
color-modes = true;
soft-wrap = {
enable = true;
max-wrap = 25;
wrap-indicator = "";
};
};
};
languages = {
language = [
{
name = "python";
language-id = "python";
auto-format = true;
file-types = ["py"];
language-servers = ["python-lsp"];
formatter = {
command = "ruff";
args = ["-q"];
};
}
{
name = "typst";
language-id = "typst";
auto-format = false;
file-types = ["typ"];
language-servers = ["typst-lsp"];
}
{
name = "rust";
language-id = "rust";
auto-format = true;
file-types = ["rs"];
roots = ["Cargo.lock"];
language-servers = ["rust-analyzer"];
}
{
name = "nix";
language-id = "nix";
auto-format = true;
file-types = ["nix"];
roots = ["flake.lock" "flake.nix"];
language-servers = ["nil"];
formatter = {
command = "nix";
args = ["fmt"];
};
}
];
language-server = {
python-lsp = {
command = "pylsp";
};
typst-lsp = {
command = "typst-lsp";
};
rust-analyzer = {
command = "rust-analyzer";
};
nil = {
command = "nil";
};
};
};
2024-04-27 14:40:15 +02:00
};
}