From d290d25a3e1cb3e1a426ebcb4c966ff50b8f92e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 15:50:19 +0000 Subject: [PATCH 1/7] Initial plan From a1f28fca855deb013fef252db4c6606417d13bab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 15:52:19 +0000 Subject: [PATCH 2/7] Complete cross-platform reliability fixes for Dotfiles - Guard Homebrew eval in .zprofile for both /opt/homebrew and /usr/local - Remove duplicate EDITOR/VISUAL exports (handled by .shell_common) - Move .shell_common sourcing early in .zshrc (before Modern CLI Replacements) - Fix duh alias to use BSD-compatible -d flag instead of --max-depth - Convert zipr alias to function for better functionality - Change git push default to simple for better behavior - Update git discard alias to use modern restore command - Add OS-aware skipping in stow.sh for macOS-only directories - Update README to mark Zsh as cross-platform (Both) Co-authored-by: dbmrq <15813674+dbmrq@users.noreply.github.com> --- Bootstrap/stow.sh | 4 ++++ Git/.gitconfig-essential | 4 ++-- README.md | 2 +- Shell/.shell_common | 4 ++-- Zsh/.zprofile | 10 ++++++---- Zsh/.zshrc | 14 +++++--------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Bootstrap/stow.sh b/Bootstrap/stow.sh index 96b52f3..e692d00 100755 --- a/Bootstrap/stow.sh +++ b/Bootstrap/stow.sh @@ -56,6 +56,10 @@ get_packages() { # Skip non-stow directories [[ "$dir" == "Bootstrap/" ]] && continue [[ "$dir" == "macOS/" ]] && continue # macOS-specific (apps, not symlinks) + if [[ "$(uname -s)" != "Darwin" ]]; then + [[ "$dir" == "Hammerspoon/" ]] && continue + [[ "$dir" == "TeX/" ]] && continue + fi PACKAGES+=("${dir%/}") done fi diff --git a/Git/.gitconfig-essential b/Git/.gitconfig-essential index c326e03..c2e5b0e 100644 --- a/Git/.gitconfig-essential +++ b/Git/.gitconfig-essential @@ -36,7 +36,7 @@ remotes = remote -v unstage = reset -q HEAD -- - discard = checkout -- + discard = restore -- uncommit = reset --mixed HEAD~ amend = commit --amend --no-edit @@ -50,7 +50,7 @@ wordRegex = . [push] - default = upstream + default = simple followTags = true autoSetupRemote = true diff --git a/README.md b/README.md index 18afc53..6b7710c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Works on both Intel and Apple Silicon Macs. The script is idempotent and can be | `Vim/` | Both | Vim config; Neovim uses Lua with LSP, Treesitter, Telescope | | `Yazi/` | Both | Yazi file manager configuration | | `Zellij/` | Both | Zellij terminal multiplexer configuration | -| `Zsh/` | macOS | Zsh configuration (standalone) | +| `Zsh/` | Both | Zsh configuration (standalone) | ### Shell Configuration diff --git a/Shell/.shell_common b/Shell/.shell_common index 2a3f787..78cff5a 100644 --- a/Shell/.shell_common +++ b/Shell/.shell_common @@ -19,13 +19,13 @@ alias la='ls -A' alias l='ls -CF' # Make zip archives easier -alias zipr='f() { zip -r "$1.zip" "$1"; }; f' +zipr() { zip -r "$1.zip" "$1"; } # Quick file search alias ff='find . -name' # Disk usage -alias duh='du -h --max-depth=1 2>/dev/null | sort -h' +alias duh='du -h -d 1 2>/dev/null | sort -h' # ============================================================================= # Safety prompts diff --git a/Zsh/.zprofile b/Zsh/.zprofile index 0baab6b..f5c35fd 100644 --- a/Zsh/.zprofile +++ b/Zsh/.zprofile @@ -5,9 +5,7 @@ if [[ "$OSTYPE" == darwin* ]]; then export BROWSER='open' fi -# Editors -export EDITOR='vim' -export VISUAL='vim' +# Pager export PAGER='less' # Language @@ -38,4 +36,8 @@ fi TMPPREFIX="${TMPDIR%/}/zsh" # Homebrew -eval "$(/opt/homebrew/bin/brew shellenv)" +if [[ -x /opt/homebrew/bin/brew ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +elif [[ -x /usr/local/bin/brew ]]; then + eval "$(/usr/local/bin/brew shellenv)" +fi diff --git a/Zsh/.zshrc b/Zsh/.zshrc index 70745da..dbe63a6 100644 --- a/Zsh/.zshrc +++ b/Zsh/.zshrc @@ -11,10 +11,6 @@ fi # ============================================================================= # Environment # ============================================================================= -# Default editor -export EDITOR='nvim' -export VISUAL='nvim' - # Smart URLs (from Prezto environment module) autoload -Uz is-at-least if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then @@ -43,6 +39,11 @@ unsetopt BG_NICE # Don't lower priority of background jobs unsetopt HUP # Don't kill jobs on shell exit unsetopt CHECK_JOBS # Don't report on jobs when shell exits +# ============================================================================= +# Common Shell Configuration +# ============================================================================= +[[ -f "$HOME/.shell_common" ]] && source "$HOME/.shell_common" + # ============================================================================= # History # ============================================================================= @@ -320,11 +321,6 @@ if command -v nnn &>/dev/null; then } fi -# ============================================================================= -# Common Shell Configuration -# ============================================================================= -[[ -f "$HOME/.shell_common" ]] && source "$HOME/.shell_common" - # ============================================================================= # macOS-specific aliases # ============================================================================= From 16ab6d9ee7cf3cc586e8cae5912e9c63288456de Mon Sep 17 00:00:00 2001 From: Daniel Marques Date: Mon, 16 Feb 2026 13:01:23 -0300 Subject: [PATCH 3/7] Update .shell_common Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Shell/.shell_common | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Shell/.shell_common b/Shell/.shell_common index 78cff5a..fec6d2c 100644 --- a/Shell/.shell_common +++ b/Shell/.shell_common @@ -19,7 +19,13 @@ alias la='ls -A' alias l='ls -CF' # Make zip archives easier -zipr() { zip -r "$1.zip" "$1"; } +zipr() { + if [ -z "$1" ]; then + echo "Usage: zipr " >&2 + return 1 + fi + zip -r "$1.zip" "$1" +} # Quick file search alias ff='find . -name' From c186a6540eef06db139ae5310a7b7f18b829ab14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:05:30 +0000 Subject: [PATCH 4/7] Initial plan From 6fbf4d3411dc3a3eccfa2302c5d05ea19438bc79 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:07:59 +0000 Subject: [PATCH 5/7] Fix all unresolved Copilot review comments Co-authored-by: dbmrq <15813674+dbmrq@users.noreply.github.com> --- Bootstrap/stow.sh | 3 ++- README.md | 2 +- Zsh/.zprofile | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Bootstrap/stow.sh b/Bootstrap/stow.sh index e692d00..140a985 100755 --- a/Bootstrap/stow.sh +++ b/Bootstrap/stow.sh @@ -52,11 +52,12 @@ get_packages() { fi done else + local os=$(uname -s) for dir in */; do # Skip non-stow directories [[ "$dir" == "Bootstrap/" ]] && continue [[ "$dir" == "macOS/" ]] && continue # macOS-specific (apps, not symlinks) - if [[ "$(uname -s)" != "Darwin" ]]; then + if [[ "$os" != "Darwin" ]]; then [[ "$dir" == "Hammerspoon/" ]] && continue [[ "$dir" == "TeX/" ]] && continue fi diff --git a/README.md b/README.md index 6b7710c..f59c798 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Both Bash and Zsh source `~/.shell_common` for shared settings: - PATH configuration - Editor setup (auto-detects nvim if available) -Platform-specific options are in `.bash_aliases` (Linux) and `.zshrc` (macOS). +Platform-specific options are in `.bash_aliases` (Linux-specific) and `.zshrc` (additional shell-specific configuration). ## Individual Scripts diff --git a/Zsh/.zprofile b/Zsh/.zprofile index f5c35fd..5bf5aa4 100644 --- a/Zsh/.zprofile +++ b/Zsh/.zprofile @@ -5,6 +5,10 @@ if [[ "$OSTYPE" == darwin* ]]; then export BROWSER='open' fi +# Editor +export EDITOR='vim' +export VISUAL="$EDITOR" + # Pager export PAGER='less' From 567c7e2ff1349d5b62f6894b1e6abea9c8674245 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:25:55 +0000 Subject: [PATCH 6/7] Initial plan From 9ea5981740cb0b132228c54c26c3e3042c228508 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:27:35 +0000 Subject: [PATCH 7/7] Fix ShellCheck SC2155 warning in Bootstrap/stow.sh Co-authored-by: dbmrq <15813674+dbmrq@users.noreply.github.com> --- Bootstrap/stow.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bootstrap/stow.sh b/Bootstrap/stow.sh index 140a985..11725bc 100755 --- a/Bootstrap/stow.sh +++ b/Bootstrap/stow.sh @@ -52,7 +52,8 @@ get_packages() { fi done else - local os=$(uname -s) + local os + os=$(uname -s) for dir in */; do # Skip non-stow directories [[ "$dir" == "Bootstrap/" ]] && continue