fix(zsh): defend the sourced zshrc against the /etc/zshrc defaults
/etc/zshrc renders promptInit and environment.shellAliases after interactiveShellInit, so both overrode the shared zshrc: the prompt became `prompt suse` and ls/ll/l fell back to coreutils. The plugin sourcing in the zshrc points at the Arch path /usr/share/zsh/plugins and silently found nothing. Clear promptInit, drop the three aliases with null, and enable the syntax-highlighting and autosuggestions modules.
This commit is contained in:
1 parent
427e667dff
commit
a5d6c3eb77
2 files changed
+73
No files matched your search
@@ -129,6 +129,32 @@ in
|
||||
source ${moonarchSrc}/defaults/shell/zshrc
|
||||
'';
|
||||
|
||||
# /etc/zshrc places promptInit after interactiveShellInit, and its default
|
||||
# ends in `prompt suse`, which assigns PS1 — the same parameter as PROMPT.
|
||||
# Left at the default it overwrites the prompt the sourced zshrc just set.
|
||||
# The zshrc owns the prompt, so nothing else has to run here.
|
||||
programs.zsh.promptInit = "";
|
||||
|
||||
# The zshrc sources both plugins from /usr/share/zsh/plugins, the path the
|
||||
# Arch packages use; the lookups are guarded and silently find nothing here.
|
||||
# These modules source the same plugins from the store instead. The strategy
|
||||
# is the one the zshrc sets on Arch.
|
||||
programs.zsh.syntaxHighlighting.enable = true;
|
||||
programs.zsh.autosuggestions = {
|
||||
enable = true;
|
||||
strategy = [ "history" "completion" ];
|
||||
};
|
||||
|
||||
# environment.shellAliases carries ls, ll and l as defaults, and /etc/zshrc
|
||||
# renders them after interactiveShellInit, so they shadow the eza aliases of
|
||||
# the sourced zshrc. null drops an alias. Scoped to zsh: bash keeps the
|
||||
# coreutils ls, which is the only thing it has.
|
||||
programs.zsh.shellAliases = {
|
||||
ls = null;
|
||||
ll = null;
|
||||
l = null;
|
||||
};
|
||||
|
||||
# --- File manager ---
|
||||
#
|
||||
# Counterpart to thunar, thunar-volman, thunar-archive-plugin, tumbler and
|
||||
|
||||
Reference in new issue
Block a user