aboutsummaryrefslogtreecommitdiff
path: root/modules/zsh.nix
blob: d2523963700170d870c08500552d92609f9b001c (plain)
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
{ config, lib, pkgs, ... }:

let
  cfg = config.zsh;
in {
  options.zsh.enable = lib.mkEnableOption "Configure zsh";

  config = lib.mkIf cfg.enable {
    programs.zsh = {
      enable = true;
      enableCompletion = true;
      autosuggestion.enable = true;
      syntaxHighlighting.enable = true;

      initExtra = ''
        # Directory completion with trailing slash
        zstyle ':completion:*' list-dirs-first true
        zstyle ':completion:*' special-dirs true
        zstyle ':completion:*' squeeze-slashes true
        zstyle ':completion:*' add-space false
      '';

      zplug = {
        enable = true;
        plugins = [
          { name = "mafredri/zsh-async"; }
          { name = "zpm-zsh/colorize"; }
          { name = "sindresorhus/pure"; tags = [ "as:theme" "use:pure.zsh" ]; }
          { name = "zdharma-continuum/fast-syntax-highlighting"; }
          { name = "agkozak/zsh-z"; }
          { name = "zsh-users/zsh-autosuggestions"; }
        ];
      };
    };
  };
}