nichts/modules/editors/helix.nix

43 lines
1.3 KiB
Nix
Raw Normal View History

{ 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;
cursor-shape = { insert = "bar"; };
statusline.left =
2024-05-15 12:24:53 +02:00
2024-05-21 23:41:23 +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
};
languages.language = [{
name = "nix";
auto-format = true;
2024-05-15 12:24:53 +02:00
formatter.command = "${pkgs.nixfmt-classic}/bin/nixfmt";
}];
};
2024-05-14 23:47:14 +02:00
};
};
2024-05-14 23:47:14 +02:00
}