fix(zsh): fixed highlighting not working on history-search-end

This commit is contained in:
Patrick 2023-09-18 13:28:34 +02:00
parent 8cd3771da0
commit 9670f735a2
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
3 changed files with 27 additions and 6 deletions

View file

@ -70,6 +70,20 @@ in {
flip mapAttrs hmUserCfg.home.persistence
(_: sourceCfg: {
users.${user} = {
# This needs to be set for allo users with non
# standart home (not /home/<userName>
# due to nixpkgs it
# can't be deduced from homeDirectory
# as there will be infinite recursion
# If this setting is forgotten there
# are assertions in place warning you
home =
{
patrick = "/home/patrick";
root = "/root";
}
.${user}
or {};
files = mkUserFiles sourceCfg.files;
directories = mkUserDirs sourceCfg.directories;
};

View file

@ -25,6 +25,7 @@
programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true;
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
@ -35,6 +36,15 @@
share = false;
};
initExtra = builtins.readFile ./zshrc;
# This needs to be loaded befor zsh-fast-syntax-highlighting
# is sourced as that overwrites all widgets to redraw with highlighting
initExtraBeforeCompInit = ''
if autoload history-search-end; then
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
fi
'';
plugins = [
{
name = "fzf-tab";
@ -87,4 +97,7 @@
}
];
};
home.persistence."/state".directories = [
".local/share/zsh"
];
}

View file

@ -97,12 +97,6 @@ function zshaddhistory() {
emulate -L zsh
[[ ! $1 =~ "$HISTORY_IGNORE_REGEX" ]]
}
if autoload history-search-end; then
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
fi
# Delete all keybinds and use emacs-like key bindings by default:
bindkey -d
bindkey -e