feat: omz -> direct, z -> zoxide, rg and fzf bindings

This commit is contained in:
2026-02-12 10:35:02 +00:00
parent 41c8b97786
commit 2486afd158
6 changed files with 120 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------
# Description:
# Configure zsh shell.
# Configure zsh shell with direct plugin management.
#
# install zsh
@@ -26,28 +26,33 @@ fi
zsh --version
# install oh-my-zsh
export ZSH="$HOME/.oh-my-zsh"
if [ ! -d "$ZSH" ]; then
# https://github.com/ohmyzsh/ohmyzsh#unattended-install
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
export ZSH_CUSTOM="$ZSH/custom"
# install zsh-syntax-highlighting
export ZSH_SYNTAX_HIGHLIGHTING="$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
if [ ! -d "$ZSH_SYNTAX_HIGHLIGHTING" ]; then
git clone -q \
https://github.com/zsh-users/zsh-syntax-highlighting.git \
"$ZSH_SYNTAX_HIGHLIGHTING"
fi
# plugin directory (XDG compliant)
PLUGIN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins"
mkdir -p "$PLUGIN_DIR"
# install zsh-autosuggestions
export ZSH_AUTOSUGGESTIONS="$ZSH_CUSTOM/plugins/zsh-autosuggestions"
if [ ! -d "$ZSH_AUTOSUGGESTIONS" ]; then
if [ ! -d "$PLUGIN_DIR/zsh-autosuggestions" ]; then
git clone -q \
https://github.com/zsh-users/zsh-autosuggestions.git \
"$ZSH_AUTOSUGGESTIONS"
"$PLUGIN_DIR/zsh-autosuggestions"
fi
# install zsh-syntax-highlighting
if [ ! -d "$PLUGIN_DIR/zsh-syntax-highlighting" ]; then
git clone -q \
https://github.com/zsh-users/zsh-syntax-highlighting.git \
"$PLUGIN_DIR/zsh-syntax-highlighting"
fi
# warn about legacy oh-my-zsh directory
if [ -d "$HOME/.oh-my-zsh" ]; then
log_warn "Legacy ~/.oh-my-zsh directory found. Remove with: rm -rf ~/.oh-my-zsh"
fi
# migrate zoxide database from z if available
if command -v zoxide &>/dev/null && [ -f "$HOME/.z" ]; then
log_info "Importing z database into zoxide..."
zoxide import --from z "$HOME/.z" 2>/dev/null || true
fi
# change default shell to zsh