nichts/modules/editors/helix.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
...
}: let
2024-07-20 13:18:01 +02:00
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
2024-07-20 13:18:01 +02:00
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;
settings = {
editor = {
line-number = "relative";
mouse = false;
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-05-22 14:29:45 +02:00
languages.language = [
{
name = "nix";
auto-format = true;
2024-07-30 19:24:53 +02:00
formatter.command = "${pkgs.alejandra}/bin/alejandra";
language-servers = ["${pkgs.nil}/bin/nil"];
2024-05-22 14:29:45 +02:00
}
];
};
2024-05-14 23:47:14 +02:00
};
};
2024-05-14 23:47:14 +02:00
}