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;
|
2024-05-15 00:14:59 +02:00
|
|
|
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 {
|
2024-05-15 00:14:59 +02:00
|
|
|
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;
|
2024-05-15 00:14:59 +02:00
|
|
|
lsp.display-messages = true;
|
2024-05-22 14:29:45 +02:00
|
|
|
cursor-shape = {insert = "bar";};
|
|
|
|
statusline.left = ["mode" "spinner" "version-control" "file-name"];
|
2024-05-15 00:14:59 +02:00
|
|
|
};
|
|
|
|
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"];
|
2024-05-15 00:14:59 +02:00
|
|
|
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-15 00:14:59 +02:00
|
|
|
};
|
2024-05-14 23:47:14 +02:00
|
|
|
};
|
2024-05-15 00:14:59 +02:00
|
|
|
};
|
2024-05-14 23:47:14 +02:00
|
|
|
}
|