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 = [ imports = [
./languages.nix
./themes/catppuccin_mocha.nix ./themes/catppuccin_mocha.nix
]; ];
programs.helix = { programs.helix = {
@ -7,9 +8,25 @@
settings = { settings = {
theme = "catppuccin_mocha"; theme = "catppuccin_mocha";
editor = { editor = {
auto-save = true;
true-color = true; true-color = true;
color-modes = true; color-modes = true;
cursorline = 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 = { cursor-shape = {
insert = "bar"; insert = "bar";
normal = "block"; normal = "block";
@ -18,37 +35,20 @@
indent-guides = { indent-guides = {
render = true; render = true;
rainbow = "dim"; rainbow = "dim";
character = "";
languages = [ };
{ whitespace = {
name = "nix"; characters = {
auto-format = true; space = "·";
} nbsp = "";
{ tab = "";
name = "rust"; newline = "";
} tabpad = "·";
{ };
name = "go"; };
} lsp = {
{ display-messages = true;
name = "lua"; display-inlay-hints = true;
}
{
name = "python";
}
{
name = "markdown";
}
{
name = "html";
}
{
name = "css";
}
{
name = "yaml";
}
];
}; };
}; };
}; };

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"];
};
};
};
}