summaryrefslogblamecommitdiff
path: root/components/programs/zsh.nix
blob: b5b97a285137321ab7f11ab720f780dc8dbf2cc7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                     
                                                       





                                       
 





                                       
                               
 
                                  

        







                                        














                                         
{lib, config, ...}: {
  options.zsh.enable = lib.mkEnableOption "ZSH config";

  config = lib.mkIf config.zsh.enable {
    programs.zsh = {
      enable = true;
      enableCompletion = true;
      enableVteIntegration = true;

      syntaxHighlighting.enable = true;

      history.size = 10000;

      oh-my-zsh = {
        enable = true;
        theme = "robbyrussell";

        plugins = [ "git" "ssh" ];
      };

      shellAliases = {
        ls = "eza";
        l = "ls -lh";
        ll = "ls -lah";

        ssh = "TERM=xterm-256color ssh";
      };

      initContent = ''
          # Ctrl + arrow keys
          bindkey '^[Oc' forward-word
          bindkey '^[Od' backward-word
          bindkey '^[[1;5D' backward-word
          bindkey '^[[1;5C' forward-word
          bindkey '^H' backward-kill-word

          # Theme
          autoload -U colors
          colors
      '';
    };
  };
}