2024-05-15 00:37:31 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2024-05-15 00:14:59 +02:00
|
|
|
with lib;
|
|
|
|
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 20:51:26 +02:00
|
|
|
options.modules.editors.helix.enable = mkEnableOption "helix";
|
2024-05-14 23:47:14 +02:00
|
|
|
|
2024-05-15 00:14:59 +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;
|
2024-05-15 00:14:59 +02:00
|
|
|
lsp.display-messages = true;
|
|
|
|
cursor-shape = { insert = "bar"; };
|
|
|
|
statusline.left =
|
2024-05-15 12:24:53 +02:00
|
|
|
|
2024-05-15 00:14:59 +02:00
|
|
|
[ "mode" "spinner" "version-control" "file-name" ];
|
|
|
|
};
|
|
|
|
keys.normal = {
|
|
|
|
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-15 00:14:59 +02:00
|
|
|
languages.language = [{
|
|
|
|
name = "nix";
|
|
|
|
auto-format = true;
|
2024-05-15 12:24:53 +02:00
|
|
|
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
|
|
|
}
|