feat: omz -> direct, z -> zoxide, rg and fzf bindings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -48,6 +48,9 @@ typeset -a MISE_TOOLS=(
|
||||
"gh@2.86.0"
|
||||
"terraform@1.14.4"
|
||||
"firebase@15.5.1"
|
||||
"fzf@latest"
|
||||
"zoxide@latest"
|
||||
"ripgrep@latest"
|
||||
)
|
||||
|
||||
# Install all tools in parallel
|
||||
@@ -64,14 +67,11 @@ done
|
||||
eval "$(mise activate bash)"
|
||||
export PATH="$HOME/.local/share/mise/shims:$PATH"
|
||||
|
||||
# Setup Poetry ZSH completions
|
||||
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
|
||||
if [[ -d "$ZSH_CUSTOM/plugins" ]]; then
|
||||
POETRY_PLUGIN="$ZSH_CUSTOM/plugins/poetry"
|
||||
if [ ! -d "$POETRY_PLUGIN" ]; then
|
||||
mkdir -p "$POETRY_PLUGIN"
|
||||
mise exec -- poetry completions zsh > "$POETRY_PLUGIN/_poetry"
|
||||
fi
|
||||
# Setup Poetry ZSH completions (XDG compliant)
|
||||
COMPLETIONS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/completions"
|
||||
mkdir -p "$COMPLETIONS_DIR"
|
||||
if [ ! -f "$COMPLETIONS_DIR/_poetry" ]; then
|
||||
mise exec -- poetry completions zsh > "$COMPLETIONS_DIR/_poetry"
|
||||
fi
|
||||
|
||||
# Verify installations using mise exec
|
||||
|
||||
Reference in New Issue
Block a user