zsh: add zoxide/bat/delta, starship prompt config, extra history options; rewrite README
Bootstrap (zshrc-bootstrap.zsh): - Add bat and zoxide to the cross-distro install loop - Add git-delta install block (package is 'git-delta' on every PM but binary is 'delta', mirroring the starship/lazydocker pattern) - Debian/Ubuntu compat: symlink batcat->bat and fdfind->fd into ~/.local/bin so zshrc integrations work under both names - Bump ZSHRC_BOOTSTRAP_VERSION 2 -> 3 so existing machines re-run the bootstrap and auto-install the new tools zshrc: - Add setopts HIST_VERIFY, EXTENDED_HISTORY, AUTO_PUSHD, PUSHD_IGNORE_DUPS, PUSHD_SILENT - Self-configuring tool integrations (all behind command -v guards): - zoxide: eval $(zoxide init zsh) for frecent 'z'/'zi' dir jumping - bat: alias cat->bat, BAT_THEME, colored MANPAGER via bat - delta: GIT_PAGER=delta for prettier git diff/log/show - Extend the interactive auto-update block to also sync starship.toml to ~/.config/starship.toml (overwrite-if-changed, validated the same way as zshrc); keep the reproducible/self-configuring design - Inverted hyperlink fix already landed in prior commit; no change here starship.toml (new): - Two-line prompt: directory + git status + cmd duration on line 1, arrow (red on error) on line 2; Nerd Font symbols, SSH host/user, Python/Node/Rust/Go/Java/Docker context blocks - Validated clean with starship 1.21.1 (uses [nodejs], not [node]) README.md: - Full rewrite: documents the design philosophy, all files, deps, integrations, history options, aliases, keybindings, the eza hyperlink workaround rationale, auto-update behavior, per-machine overrides, env vars, and helper functions
This commit is contained in:
+27
-1
@@ -7,7 +7,7 @@ mkdir -p "$HOME/.local/bin"
|
||||
mkdir -p "$ZSH_CONFIG"
|
||||
path+=("$HOME/.local/bin")
|
||||
|
||||
for p in git starship fzf eza rsync lazydocker fastfetch tmux; do
|
||||
for p in git starship fzf eza rsync lazydocker fastfetch tmux bat zoxide; do
|
||||
command -v $p >/dev/null && continue
|
||||
if command -v brew >/dev/null; then
|
||||
echo "Installing $p using brew" && brew install $p && continue
|
||||
@@ -37,6 +37,32 @@ if ! command -v lazydocker >/dev/null; then
|
||||
DIR=$HOME/.local/bin bash >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Debian/Ubuntu ships bat as 'batcat' and fd as 'fdfind'; symlink to the
|
||||
# canonical names so the zshrc integrations (which call bat/fd) work everywhere.
|
||||
if ! command -v bat >/dev/null && command -v batcat >/dev/null; then
|
||||
ln -sf "$(command -v batcat)" "$HOME/.local/bin/bat"
|
||||
fi
|
||||
if ! command -v fd >/dev/null && command -v fdfind >/dev/null; then
|
||||
ln -sf "$(command -v fdfind)" "$HOME/.local/bin/fd"
|
||||
fi
|
||||
|
||||
# git-delta: the package is named 'git-delta' on every package manager but the
|
||||
# binary is 'delta' (name mismatch vs the install loop above), so install via the
|
||||
# same PM cascade using the real package name. Used by zshrc as GIT_PAGER.
|
||||
if ! command -v delta >/dev/null; then
|
||||
if command -v brew >/dev/null; then
|
||||
echo "Installing git-delta using brew" && brew install git-delta
|
||||
elif command -v apt >/dev/null && apt-cache show git-delta >/dev/null 2>&1; then
|
||||
echo "Installing git-delta using Apt" && sudo apt install git-delta -y
|
||||
elif command -v dnf >/dev/null && dnf list available git-delta >/dev/null 2>&1; then
|
||||
echo "Installing git-delta using dnf" && sudo dnf install git-delta -y
|
||||
elif command -v pacman >/dev/null && pacman -Si git-delta >/dev/null 2>&1; then
|
||||
echo "Installing git-delta using pacman" && sudo pacman -Sy --noconfirm git-delta
|
||||
elif command -v cargo >/dev/null; then
|
||||
echo "Installing git-delta using cargo" && cargo install git-delta --locked
|
||||
fi
|
||||
fi
|
||||
|
||||
arch=$(uname -m)
|
||||
case "$arch" in
|
||||
x86_64) target_fast="linux-amd64" && target_eza="x86_64-unknown-linux-gnu" ;;
|
||||
|
||||
Reference in New Issue
Block a user