nichts/modules/editors/helix.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
...
}: let
2024-05-21 20:51:26 +02:00
cfg = config.modules.editors.helix;
username = config.modules.other.system.username;
in {
2024-05-21 23:41:23 +02:00
options.modules.editors.helix.enable = lib.mkEnableOption "helix";
2024-05-14 23:47:14 +02:00
2024-05-21 23:41:23 +02:00
config = lib.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"];
C-t = [":new" ":insert-output fish" ":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;
formatter.command = "${pkgs.nixfmt-classic}/bin/nixfmt";
}
];
};
2024-05-14 23:47:14 +02:00
};
};
2024-05-14 23:47:14 +02:00
}