diff options
-rw-r--r-- | common/commandline/zsh.nix | 86 |
1 files changed, 46 insertions, 40 deletions
diff --git a/common/commandline/zsh.nix b/common/commandline/zsh.nix index 9f05386..17504e9 100644 --- a/common/commandline/zsh.nix +++ b/common/commandline/zsh.nix | |||
@@ -1,4 +1,5 @@ | |||
1 | inputs: { | 1 | inputs: |
2 | { | ||
2 | config, | 3 | config, |
3 | lib, | 4 | lib, |
4 | pkgs, | 5 | pkgs, |
@@ -7,7 +8,8 @@ inputs: { | |||
7 | let | 8 | let |
8 | inherit (inputs.self.lib.theme) fgEscapeCode; | 9 | inherit (inputs.self.lib.theme) fgEscapeCode; |
9 | dominantEscapeCode = fgEscapeCode config.theme.colors.dominant; | 10 | dominantEscapeCode = fgEscapeCode config.theme.colors.dominant; |
10 | in { | 11 | in |
12 | { | ||
11 | programs.zsh = { | 13 | programs.zsh = { |
12 | enable = true; | 14 | enable = true; |
13 | 15 | ||
@@ -28,10 +30,11 @@ in { | |||
28 | } | 30 | } |
29 | 31 | ||
30 | # Grml's ZSH config overrides less variables | 32 | # Grml's ZSH config overrides less variables |
31 | export ${lib.concatStringsSep " " | 33 | export ${ |
32 | (lib.mapAttrsToList | 34 | lib.concatStringsSep " " ( |
33 | (variable: value: "${variable}=\"${value}\"") | 35 | lib.mapAttrsToList (variable: value: "${variable}=\"${value}\"") config.programs.less.envVariables |
34 | config.programs.less.envVariables)} | 36 | ) |
37 | } | ||
35 | ''; | 38 | ''; |
36 | 39 | ||
37 | # otherwise it'll override the grml prompt | 40 | # otherwise it'll override the grml prompt |
@@ -39,11 +42,6 @@ in { | |||
39 | # Grml handles that, and supports cache (faster!!!) | 42 | # Grml handles that, and supports cache (faster!!!) |
40 | enableGlobalCompInit = false; | 43 | enableGlobalCompInit = false; |
41 | 44 | ||
42 | syntaxHighlighting = { | ||
43 | enable = true; | ||
44 | highlighters = ["main" "brackets" "line"]; | ||
45 | }; | ||
46 | |||
47 | shellAliases = { | 45 | shellAliases = { |
48 | e = "\${(z)EDITOR}"; | 46 | e = "\${(z)EDITOR}"; |
49 | # Space at the end makes Zsh expand aliases after "sudo" | 47 | # Space at the end makes Zsh expand aliases after "sudo" |
@@ -59,35 +57,43 @@ in { | |||
59 | users.defaultUserShell = pkgs.zsh; | 57 | users.defaultUserShell = pkgs.zsh; |
60 | 58 | ||
61 | home-manager.sharedModules = [ | 59 | home-manager.sharedModules = [ |
62 | ({config, ...}: { | 60 | ( |
63 | programs.zsh = { | 61 | { config, ... }: |
64 | enable = true; | 62 | { |
65 | # Completion is already handled by the GRML conf | 63 | programs.zsh = { |
66 | enableCompletion = false; | 64 | enable = true; |
67 | 65 | # Completion is already handled by the GRML conf | |
68 | history = { | 66 | enableCompletion = false; |
69 | extended = true; | 67 | |
70 | expireDuplicatesFirst = true; | 68 | history = { |
71 | ignoreDups = true; | 69 | extended = true; |
72 | ignorePatterns = ["run-help *"]; | 70 | expireDuplicatesFirst = true; |
73 | 71 | ignoreDups = true; | |
74 | # different, for expireDuplicatesFirst | 72 | ignorePatterns = [ "run-help *" ]; |
75 | size = 1100; | 73 | |
76 | save = 1000; | 74 | # different, for expireDuplicatesFirst |
75 | size = 1100; | ||
76 | save = 1000; | ||
77 | }; | ||
78 | |||
79 | # XDG | ||
80 | dotDir = ".config/zsh"; | ||
81 | history.path = "${config.xdg.dataHome}/zsh/zsh_history"; | ||
82 | |||
83 | plugins = [ | ||
84 | { | ||
85 | name = "shmart-prompt-dir"; | ||
86 | src = inputs.shmart-prompt-dir; | ||
87 | file = "none"; | ||
88 | } | ||
89 | |||
90 | { | ||
91 | name = "fast-syntax-highlighting"; | ||
92 | src = "${pkgs.unstable.zsh-fast-syntax-highlighting}/share/zsh/site-functions"; | ||
93 | } | ||
94 | ]; | ||
77 | }; | 95 | }; |
78 | 96 | } | |
79 | # XDG | 97 | ) |
80 | dotDir = ".config/zsh"; | ||
81 | history.path = "${config.xdg.dataHome}/zsh/zsh_history"; | ||
82 | |||
83 | plugins = [ | ||
84 | { | ||
85 | name = "shmart-prompt-dir"; | ||
86 | src = inputs.shmart-prompt-dir; | ||
87 | file = "none"; | ||
88 | } | ||
89 | ]; | ||
90 | }; | ||
91 | }) | ||
92 | ]; | 98 | ]; |
93 | } | 99 | } |