irongit
dotzsh/before_plugins.sh
31 lines1.2 KBBourne Again Shell (bash)
1# Update PATH
2export PATH="$PATH:$HOME/.local/bin:$HOME/go/bin:$HOME/.avm/bin:/usr/local/go/bin"
3export PATH="$PATH:$HOME/.local/share/solana/install/active_release/bin"
4export PATH="$HOME/.local/share/fnm:$PATH"
5export PATH="$PATH:/usr/local/flutter/bin"
6
7# Set up a cached file as a subprocess with all the home rust debug paths in it
8(
9 mkdir -p ~/.cache
10 fd -I -c never -E 'doc' -E 'package' --full-path 'target/debug$' ~ | tr '\n' ':' >~/.cache/RUST_DEBUG_PATHS
11)
12[ -f ~/.cache/RUST_DEBUG_PATHS ] && RUST_DEBUG_PATHS="$(cat ~/.cache/RUST_DEBUG_PATHS)" && export PATH="$PATH:$RUST_DEBUG_PATHS"
13
14# Add environments
15[ -f ~/.fzf.zsh ] && . ~/.fzf.zsh
16[ -f ~/.cargo/env ] && . "$HOME/.cargo/env"
17[ -f ~/.venv/bin/activate ] && . ~/.venv/bin/activate
18eval "$(fnm env)"
19
20# Create completions into ~/.config/.zfuncs directory
21zfunc_dir="$ZDOTDIR/.zfunc"
22if [ ! -d "$zfunc_dir" ]; then mkdir -p "$zfunc_dir" &>/dev/null; fi
23add_completions() {
24 local file="$zfunc_dir/$1"
25 if [ ! -f "$file" ]; then
26 eval "$2" >"$file"
27 fi
28}
29add_completions _fnm 'fnm completions --shell zsh'
30add_completions _rustup 'rustup completions zsh'
31add_completions _uv 'uv generate-shell-completion zsh'