helix: configure languages + editor

This commit is contained in:
notohh 2023-05-25 12:43:26 -04:00
parent 55d2cea9ad
commit fbeda87c0f
Signed by: notohh
GPG key ID: BD47506D475EE86D
2 changed files with 65 additions and 31 deletions

View file

@ -1,5 +1,6 @@
{...}: {
imports = [
./languages.nix
./themes/catppuccin_mocha.nix
];
programs.helix = {
@ -7,9 +8,25 @@
settings = {
theme = "catppuccin_mocha";
editor = {
auto-save = true;
true-color = true;
color-modes = true;
cursorline = true;
completion-replace = true;
soft-wrap.enable = true;
idle-timeout = 1;
gutters = ["diff" "diagnostics" "line-numbers" "spacer"];
statusline = {
left = ["mode" "spinner"];
center = ["file-name"];
right = ["diagnostics" "selections" "position" "file-line-ending" "file-type" "version-control"];
separator = "|";
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
cursor-shape = {
insert = "bar";
normal = "block";
@ -18,37 +35,20 @@
indent-guides = {
render = true;
rainbow = "dim";
languages = [
{
name = "nix";
auto-format = true;
}
{
name = "rust";
}
{
name = "go";
}
{
name = "lua";
}
{
name = "python";
}
{
name = "markdown";
}
{
name = "html";
}
{
name = "css";
}
{
name = "yaml";
}
];
character = "";
};
whitespace = {
characters = {
space = "·";
nbsp = "";
tab = "";
newline = "";
tabpad = "·";
};
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
};
};

34
home/helix/languages.nix Normal file
View file

@ -0,0 +1,34 @@
{
pkgs,
lib,
...
}: {
programs.helix.languages = {
language = with pkgs; [
{
name = "nix";
auto-format = true;
formatter = {
command = lib.getExe alejandra;
args = ["-q"];
};
}
{
name = "rust";
auto-format = true;
formatter = {
command = lib.getExe rustfmt;
};
}
];
language-server = with pkgs; {
nil = {
command = lib.getExe nil;
};
vscode-css-language-server = {
command = "${nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver";
args = ["--stdio"];
};
};
};
}