{ lib, pkgs, ... }:
 
{
  programs.kitty = {
    enable = true;
    keybindings."ctrl+shift+p>n" = ''kitten hints --type=linenum --linenum-action=window ${lib.getExe pkgs.bat} --pager "less --RAW-CONTROL-CHARS +{line}" -H {line} {path}'';
    settings = {
      select_by_word_characters = "@-./_~?&%+#";
      scrollback_lines = 20000;
      scrollback_pager_history_size = 20; # 10k line / MiB
    };
    shellIntegration.mode = "no-sudo";
  };
 
  programs.zsh.initContent = ''
    ssh() {
      TERM=''${TERM/-kitty/-256color} command ssh "$@"
    }
  '';
}
home-manager

We need to tell stylix, that we want to use a 256 color theme, otherwise there can be accessibility issues with color mapping, e.g. comment color will be unreadable dark in editors.

{
  stylix.targets.kitty.variant256Colors = true;
}
home-manager