zsh: allow setting custom syntax highlighting styles (#4122)
* zsh: allow setting custom syntax highlighting styles Custom styles allow overriding the default colors. Example: ```nix zsh.syntaxHighlighting.styles.comment = "fg=#6c6c6c"; ``` See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md * zsh: allow configuring syntax-highlighting package
This commit is contained in:
parent
9dd107a1d5
commit
f5f64ac022
3 changed files with 58 additions and 6 deletions
|
|
@ -7,4 +7,5 @@
|
|||
zsh-history-ignore-pattern = ./history-ignore-pattern.nix;
|
||||
zsh-history-substring-search = ./history-substring-search.nix;
|
||||
zsh-prezto = ./prezto.nix;
|
||||
zsh-syntax-highlighting = ./syntax-highlighting.nix;
|
||||
}
|
||||
|
|
|
|||
23
tests/modules/programs/zsh/syntax-highlighting.nix
Normal file
23
tests/modules/programs/zsh/syntax-highlighting.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
package = pkgs.hello;
|
||||
styles.comment = "fg=#6c6c6c";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.zsh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContains home-files/.zshrc "source ${pkgs.hello}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES['comment']='fg=#6c6c6c'"
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue