summaryrefslogtreecommitdiffstats
path: root/zsh-darwin.nix
blob: 74e164f1cc5363110cdf26cd17f1f5abdf45e4f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  config,
  pkgs,
  ...
}: {
  environment.systemPackages = with pkgs; [
    direnv
    fzf
    zoxide
  ];

  programs.zsh = {
    enable = true;
    enableAutosuggestions = true;
    enableBashCompletion = true;
    enableCompletion = true;
    enableGlobalCompInit = true;
    enableFastSyntaxHighlighting = true;
    enableFzfCompletion = true;
    enableFzfGit = true;
    enableFzfHistory = true;
    histFile = "$HOME/.zsh_history";
    histSize = 100000;
    promptInit = ''
      PROMPT=$'%{\e[97m%}[%{\e[m%}%{\e[92m%}%n%{\e[m%}%{\e[32m%}@%{\e[m%}%{\e[92m%}%m%{\e[m%}:%{\e[92m%}%~%{\e[m%}%{\e[97m%}]%{\e[m%}%{\e[97m%}%#%{\e[m%} '
    '';
    interactiveShellInit = ''
      eval "$(direnv hook zsh)"
      eval "$(zoxide init zsh)"

      setopt autocd extendedglob nomatch notify

      bindkey -v
      export KEYTIMEOUT=20
    '';
  };
}