Created
April 30, 2026 18:04
-
-
Save cesasol/b2fe5c5e05f0d07a6e522da1b4bc9506 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| skip_global_compinit=1 | |
| # XDG data dirs | |
| if [[ $OSTYPE =~ "linux" ]]; then | |
| export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" | |
| export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" | |
| export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" | |
| export XDG_STATE_HOME="${XDG_DATA_HOME:-$HOME/.local/state}" | |
| elif [[ $OSTYPE =~ "darwin" ]]; then | |
| # TODO: Implement missing xdg paths for mac | |
| export XDG_CACHE_HOME="${HOME}/Library/Caches" | |
| fi | |
| export EDITOR=nvim | |
| export VISUAL=nvim | |
| # Homes for other tools | |
| export PNPM_HOME="$XDG_DATA_HOME/pnpm" | |
| export IPFS_PATH="$XDG_DATA_HOME/ipfs" | |
| export NVM_DIR="$XDG_DATA_HOME/nvm" | |
| export BUN_INSTALL="$XDG_DATA_HOME/bun" | |
| # PATHS | |
| # Make sure all paths are unique arrays and exported | |
| typeset -agUx cdpath fpath mailpath path manpath | |
| # Manuals paths | |
| manpath=( | |
| "/usr/share/man" | |
| "/usr/local/man" | |
| $manpath | |
| ) | |
| # All binaries path | |
| # (N) makes sure that the path exists before appending | |
| path=( | |
| $HOME/{,s}bin(N) | |
| $HOME/.local/{,s}bin(N) | |
| $XDG_CONFIG_HOME/composer/vendor/bin(N) | |
| $XDG_DATA_HOME/bun/bin(N) | |
| $XDG_DATA_HOME/share/JetBrains/Toolboox/scripts(N) | |
| /opt/{homebrew,local}/{,s}bin(N) | |
| /usr/local/{,s}bin(N) | |
| $path | |
| ) | |
| # Browser | |
| if [[ "$OSTYPE" == darwin* ]]; then | |
| export BROWSER='open' | |
| elif (( $+commands[handlr] )); then | |
| export BROWSER='handlr open' | |
| else | |
| export BROWSER="xdg-open" | |
| fi | |
| # User dirs. | |
| export XDG_DESKTOP_DIR="$HOME/Desktop" | |
| export XDG_DOWNLOAD_DIR="$HOME/Downloads" | |
| export XDG_TEMPLATES_DIR="$HOME/Templates" | |
| export XDG_PUBLICSHARE_DIR="$HOME/Public" | |
| export XDG_DOCUMENTS_DIR="$HOME/Documents" | |
| export XDG_MUSIC_DIR="$HOME/Music" | |
| export XDG_PICTURES_DIR="$HOME/Pictures" | |
| export XDG_VIDEOS_DIR="$HOME/Videos" | |
| # | |
| export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor | |
| # History | |
| export HISTSIZE=10000 | |
| export SAVEHIST="$HISTSIZE" | |
| export HISTFILE="${XDG_STATE_HOME}/zsh_history" | |
| # ZSH Config dirs | |
| export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME}/zsh" | |
| # If ZSH is not defined, use the current script's directory. | |
| [[ -n "$ZSH" ]] || export ZSH="${${(%):-%x}:a:h}" | |
| ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/zsh" | |
| # Manuals | |
| declare -aUu manpath | |
| # You may need to manually set your language environment | |
| export LANG=en_CA.UTF-8 # I don't like imperial stuff | |
| export LC_MONETARY=es_MX.UTF-8 # This is the only that matters in my country | |
| export PAGER="less" # Maybe most | |
| export LESS='-g -i -M -R -S -w -X -z-4' | |
| if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then | |
| export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" | |
| fi | |
| export BAT_PAGER="$PAGER" | |
| export BATPIPE=color | |
| export BATPIPE_ENABLE_COLOR=true | |
| # Go | |
| [ -d "$HOME/go/bin" ] && { | |
| path+=("$HOME/go/bin") | |
| } | |
| # Luarocks bin path | |
| [ -d ${HOME}/.luarocks/bin ] && { | |
| path+=("${HOME}/.luarocks/bin") | |
| } | |
| # Added by LM Studio CLI (lms) | |
| [ -d ${HOME}/.lmstudio/bin ] && { | |
| path+=("$HOME/.lmstudio/bin") | |
| } | |
| # Cargo | |
| [ -d $HOME/.cargo/bin ] && { | |
| path+=($HOME/.cargo/bin) | |
| } | |
| # PNPM | |
| [ -d $PNPM_HOME ] && { | |
| path+=("$PNPM_HOME") | |
| } | |
| [ -d $BUN_HOME ] | |
| # Crypto | |
| [ -d "$HOME/.local/share/solana/install/active_release/bin" ] && { | |
| path+=("$HOME/.local/share/solana/install/active_release/bin") | |
| } | |
| [ -d "$HOME/.config/.foundry/bin" ] && { | |
| path+=("$HOME/.config/.foundry/bin") | |
| } | |
| export PATH; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment