nichts/modules/programs/editors/helix.nix

67 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
2024-07-30 21:04:27 +02:00
inputs',
2024-05-22 14:29:45 +02:00
...
}: let
2024-07-20 13:18:01 +02:00
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
2024-07-30 21:04:27 +02:00
inherit (lib) mkIf getExe makeBinPath;
in {
2024-07-20 13:18:01 +02:00
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;
2024-08-05 16:22:19 +02:00
# thanks fuf, this is great!
2024-07-30 21:04:27 +02:00
package = inputs'.helix.packages.default.overrideAttrs (previousAttrs: {
makeWrapperArgs = with pkgs;
previousAttrs.makeWrapperArgs
or []
++ [
"--suffix"
"PATH"
":"
(makeBinPath [
clang-tools
marksman
nil
bash-language-server
shellcheck
2024-08-03 18:10:09 +02:00
typst-lsp
2024-07-30 21:04:27 +02:00
])
];
});
settings = {
editor = {
2024-07-30 21:04:27 +02:00
indent-guides.render = true;
lsp.display-inlay-hints = true;
line-number = "relative";
2024-07-31 02:09:58 +02:00
mouse = true;
bufferline = "multiple";
2024-05-15 23:47:37 +02:00
soft-wrap.enable = true;
lsp.display-messages = true;
2024-05-22 14:29:45 +02:00
cursor-shape = {insert = "bar";};
statusline.left = ["mode" "spinner" "version-control" "file-name"];
};
keys.normal = {
2024-05-22 14:29:45 +02:00
C-g = [":new" ":insert-output lazygit" ":buffer-close!" ":redraw"];
esc = ["collapse_selection" "keep_primary_selection"];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
};
2024-05-14 23:47:14 +02:00
};
2024-07-30 21:04:27 +02:00
languages = {
language-server = {
nil = {
command = getExe pkgs.nil;
config.nil.formatting.command = ["${getExe pkgs.alejandra}" "-q"];
};
};
};
};
2024-05-14 23:47:14 +02:00
};
};
2024-05-14 23:47:14 +02:00
}