Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ef24dbc4e5 | |||
| ee503a225c |
+43
-26
@@ -33,6 +33,27 @@ _compinit_cached() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ---------- nvm ----------
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
|
||||||
|
|
||||||
|
# ---------- bun ----------
|
||||||
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
|
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
|
||||||
|
|
||||||
|
# ---------- PATH ----------
|
||||||
|
export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
|
||||||
|
export PATH="$HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:$PATH"
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$PNPM_HOME/bin:"*) ;;
|
||||||
|
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
|
||||||
|
esac
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$BUN_INSTALL/bin:"*) ;;
|
||||||
|
*) export PATH="$BUN_INSTALL/bin:$PATH" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# ---------- zinit (plugin manager, auto-install) ----------
|
# ---------- zinit (plugin manager, auto-install) ----------
|
||||||
export ZINIT_HOME=${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git
|
export ZINIT_HOME=${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git
|
||||||
if [[ ! -d $ZINIT_HOME ]]; then
|
if [[ ! -d $ZINIT_HOME ]]; then
|
||||||
@@ -61,16 +82,14 @@ zstyle ':completion:*' menu select
|
|||||||
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||||
|
|
||||||
# ---------- plugins (deferred via turbo mode for faster startup) ----------
|
# ---------- plugins ----------
|
||||||
# fzf-tab needs compinit to have already run, and needs to load before
|
# fzf-tab needs compinit to have already run, and needs to load before
|
||||||
# anything that wraps completion widgets (autosuggestions, syntax-highlighting).
|
# anything that wraps completion widgets (autosuggestions, syntax-highlighting).
|
||||||
zinit ice wait lucid atinit'_compinit_cached'
|
zinit ice atinit'_compinit_cached'
|
||||||
zinit light Aloxaf/fzf-tab
|
zinit light Aloxaf/fzf-tab
|
||||||
|
|
||||||
zinit ice wait lucid
|
|
||||||
zinit light zsh-users/zsh-autosuggestions
|
zinit light zsh-users/zsh-autosuggestions
|
||||||
|
|
||||||
zinit ice wait lucid
|
|
||||||
zinit light ajeetdsouza/zoxide
|
zinit light ajeetdsouza/zoxide
|
||||||
eval "$(zoxide init zsh)"
|
eval "$(zoxide init zsh)"
|
||||||
|
|
||||||
@@ -84,11 +103,9 @@ else
|
|||||||
fi
|
fi
|
||||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||||
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND"
|
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||||
zinit ice wait lucid
|
|
||||||
zinit light junegunn/fzf
|
zinit light junegunn/fzf
|
||||||
|
|
||||||
# syntax-highlighting must be loaded last, after any plugin that wraps widgets
|
# syntax-highlighting must be loaded last, after any plugin that wraps widgets
|
||||||
zinit ice wait lucid
|
|
||||||
zinit light zsh-users/zsh-syntax-highlighting
|
zinit light zsh-users/zsh-syntax-highlighting
|
||||||
|
|
||||||
# ---------- aliases with smart fallbacks ----------
|
# ---------- aliases with smart fallbacks ----------
|
||||||
@@ -115,8 +132,28 @@ phok() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jwtf() {
|
||||||
|
cd "$HOME/Coding/jwtf" || return
|
||||||
|
if [ "$#" -gt 0 ]; then
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# This laptop's Intel iHD VA-API driver corrupts hardware-decoded video
|
||||||
|
# frames (dmabuf allocator size-mismatch bug), and WebKitGTK's DMA-BUF
|
||||||
|
# compositing path is separately broken on this GPU/driver combo too — force
|
||||||
|
# software H.264/H.265 decode and disable DMA-BUF rendering for Phokus dev
|
||||||
|
# builds so video playback is smooth.
|
||||||
|
alias phok-dev='WEBKIT_DISABLE_DMABUF_RENDERER=1 GST_PLUGIN_FEATURE_RANK="vah264dec:0,vah265dec:0,vaapih264dec:0,vaapih265dec:0" pnpm --dir "$HOME/Coding/jwtf/apps/phokus" dev:app:cpu'
|
||||||
|
|
||||||
# ---------- misc helpers ----------
|
# ---------- misc helpers ----------
|
||||||
mkcd(){ mkdir -p "$1" && cd "$1"; }
|
mkcd(){ mkdir -p "$1" && cd "$1"; }
|
||||||
|
up(){
|
||||||
|
local n="${1:-1}"
|
||||||
|
[[ "$n" =~ ^[0-9]+$ ]] || { echo "up: expects a number"; return 1; }
|
||||||
|
local target=""
|
||||||
|
for ((i=0; i<n; i++)); do target="../$target"; done
|
||||||
|
cd "$target" || return
|
||||||
|
}
|
||||||
extract(){
|
extract(){
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*.tar.gz|*.tgz) tar xzf "$1";;
|
*.tar.gz|*.tgz) tar xzf "$1";;
|
||||||
@@ -131,23 +168,3 @@ extract(){
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------- nvm ----------
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
|
|
||||||
|
|
||||||
# ---------- bun ----------
|
|
||||||
export BUN_INSTALL="$HOME/.bun"
|
|
||||||
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
|
|
||||||
|
|
||||||
# ---------- PATH ----------
|
|
||||||
export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
|
|
||||||
export PATH="$HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:$PATH"
|
|
||||||
case ":$PATH:" in
|
|
||||||
*":$PNPM_HOME/bin:"*) ;;
|
|
||||||
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
|
|
||||||
esac
|
|
||||||
case ":$PATH:" in
|
|
||||||
*":$BUN_INSTALL/bin:"*) ;;
|
|
||||||
*) export PATH="$BUN_INSTALL/bin:$PATH" ;;
|
|
||||||
esac
|
|
||||||
|
|||||||
Reference in New Issue
Block a user