{osConfig, ...}: let
  flavor = osConfig.horseman.catppuccin.flavor;
in {
  programs.helix = {
    enable = true;
    defaultEditor = true;
    settings = {
      theme = "catppuccin_${flavor}";
      editor = {
        completion-timeout = 5;
        clipboard-provider = "wayland";
        cursor-shape = {
          normal = "block";
          insert = "bar";
          select = "underline";
        };

        soft-wrap.enable = true;
        file-picker.hidden = false;

        statusline = {
          left = ["mode" "spinner" "file-name" "read-only-indicator" "file-modification-indicator"];
          center = [];
          right = ["diagnostics" "selections" "register" "file-encoding" "position" "position-percentage"];
        };
      };
      keys = let
        reg = "<gt>";
        deleteMacro = "@\"${reg}y<A-d>";
        changeMacro = "@\"${reg}y<A-d>i";
      in {
        normal = {
          c = changeMacro;
          d = deleteMacro;

          g = {q = "@g80|";};
        };
        select = {
          c = changeMacro;
          d = deleteMacro;
        };
      };
    };
    languages.language = [];
  };
}
