[FEATURE] Restructure Zsh config to follow XDG Base Directory
维护者通常 1 天内回复
@mylinuxforwork 已经在做这个了。
开始于 2026年9月6日。
评估
这个 Issue 还没有评估数据。
描述
Is your feature request related to a problem? Please describe.
The current Zsh setup places .zshrc directly in home directory and links configs from ~/.config/zshrc/ or .zshrc_custom file that may be created in home directory. Moreover, runtime files like .zsh_history and zcompdump files end up directly in the home directory, polluting the root of home directory.
Potential conflict with existing ZDOTDIR in ~/.zshenv:
If a user already has a ~/.zshenv setting ZDOTDIR (e.g., pointing to ~/.config/zsh), Zsh will search for .zshrc inside $ZDOTDIR and completely ignore the ~/.zshrc file generated/placed by the ML4W installer in home directory. Moving to a native ZDOTDIR architecture prevents this conflict and ensures ML4W configs are loaded predictably.
Describe the solution you'd like
- Instead of putting
.zshrcin home directory, create a minimalist~/.zshenvfile that sets exportZDOTDIR="$HOME/.config/zsh". - Move all Zsh configuration files (.zshrc, aliases, plugins and etc) inside
$ZDOTDIR/(~/.config/zsh/). - Explicitly set paths inside Zsh config for history and completion dump files to keep home dir clean:
# History
HISTFILE="$ZDOTDIR/.zsh_history"
# Cache
## check if cache folder env exists and set if not
: "${XDG_CACHE_HOME:=$HOME/.cache}"
## check if ZSH folder exists in .cache folder and create if not
[[ -d "$XDG_CACHE_HOME/zsh" ]] || mkdir -p "$XDG_CACHE_HOME/zsh"
## set folder for ZSH cache
autoload -Uz compinit
compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION"
Describe alternatives you've considered
No response
Additional context
Following the XDG Base Directory Specification makes dotfiles much cleaner, modular, and easier to backup/manage.
Support or Contribution
- 主要语言
- QML
- 星标
- 5.1k
- 派生
- 386
- 平均合并
- 16 小时 45 分钟
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mylinuxforwork/dotfiles 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
mylinuxforwork/dotfiles#1904 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
mylinuxforwork/dotfiles#1829 ·
维护者通常 1 天内回复
-
enhancement solved
难度 2/5 1-3 小时 新手友好度 74/100
mylinuxforwork/dotfiles#1807 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
mylinuxforwork/dotfiles#1765 · 1 条评论 ·
维护者通常 1 天内回复
-
[FEATURE] add keycap 1 app window over all windows可能已有人在做 @mylinuxforwork 于 1 天前认领。 未关闭enhancement
mylinuxforwork/dotfiles#1902 · 已指派 1 人 ·
维护者通常 1 天内回复