-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(zsh): 設定ファイルをディレクトリ構造で再編成 #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9168cbf
de4235e
0515caf
5d47534
f8ec604
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| path.zsh | ||
| dev-tools.zsh | ||
| fzf.zsh | ||
| utils.zsh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export VISUAL="cursor" | ||
| export EDITOR="hx" | ||
|
|
||
| export NI_DEFAULT_AGENT="pnpm" | ||
| export NI_GLOBAL_AGENT="pnpm" | ||
|
|
||
| export LG_CONFIG_FILE="$HOME/.config/lazygit/config.yml" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # 長時間コマンドの完了通知 | ||
| notify-after() { | ||
| "$@" | ||
| local exit_code=$? | ||
| if (( exit_code == 0 )); then | ||
| cmux notify --title "✓ Command Complete" --body "$*" | ||
| else | ||
| cmux notify --title "✗ Command Failed" --body "$* (exit $exit_code)" | ||
| fi | ||
| return $exit_code | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [[ -f "$HOME/.docker/init-zsh.sh" ]] && source "$HOME/.docker/init-zsh.sh" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| eval "$(proto activate zsh --no-shim)" | ||
| export PROTO_AUTO_INSTALL=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [[ -f "$HOME/.vite-plus/env" ]] && source "$HOME/.vite-plus/env" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,16 +2,25 @@ | |||||||||||||||||||
|
|
||||||||||||||||||||
| ZSH_CONFIG_DIR="${HOME}/.zsh.d" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # 各設定ファイルを読み込み | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/path.zsh" | ||||||||||||||||||||
| # Core | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/core/path.zsh" | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/core/env.zsh" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| fpath+=(${ZSH_CONFIG_DIR}/completions) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/dev-tools.zsh" | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/fzf.zsh" | ||||||||||||||||||||
| [ -f "${ZSH_CONFIG_DIR}/.local.zsh" ] && source "${ZSH_CONFIG_DIR}/.local.zsh" | ||||||||||||||||||||
| # Tools | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/tools/proto.zsh" | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/tools/docker.zsh" | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/tools/fzf.zsh" | ||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/tools/vite-plus.zsh" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Sheldon | ||||||||||||||||||||
| # Machine-local overrides | ||||||||||||||||||||
| [[ -f "${ZSH_CONFIG_DIR}/.local.zsh" ]] && source "${ZSH_CONFIG_DIR}/.local.zsh" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Plugins (Sheldon) | ||||||||||||||||||||
| eval "$(sheldon source)" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| source "${ZSH_CONFIG_DIR}/utils.zsh" | ||||||||||||||||||||
| # Functions | ||||||||||||||||||||
| for f in "${ZSH_CONFIG_DIR}/functions/"*.zsh(N); do | ||||||||||||||||||||
| source "$f" | ||||||||||||||||||||
| done | ||||||||||||||||||||
|
Comment on lines
+24
to
+26
|
||||||||||||||||||||
| for f in "${ZSH_CONFIG_DIR}/functions/"*.zsh(N); do | |
| source "$f" | |
| done | |
| function_files=("${ZSH_CONFIG_DIR}/functions/"*.zsh(N)) | |
| if (( ${#function_files[@]} )); then | |
| for f in "${function_files[@]}"; do | |
| source "$f" | |
| done | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zsh の (N) glob 修飾子(Null glob)は、マッチするファイルが0件のとき展開結果を空にしてループをスキップします。for f in *.zsh(N) でマッチなしの場合にループ本体は実行されないため、配列化によるガードは不要と判断し現状を維持します。
Generated by Claude Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve maintainability and consistency with how functions are loaded (lines 24-26), consider using a loop to source all files in the
tools/directory. This allows for adding or removing tool configurations without needing to manually update.zshrceach time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools/はロード順に意味があります(core/env.zshで設定した変数をproto.zshが参照するなど)。グロブによるアルファベット順読み込みでは順序が保証できないため、今回は明示的 source を維持します。Generated by Claude Code