Skip to content

Instantly share code, notes, and snippets.

@Xeven777
Last active March 9, 2026 17:30
Show Gist options
  • Select an option

  • Save Xeven777/c10b66434910274dd5a51e9b04ab3cca to your computer and use it in GitHub Desktop.

Select an option

Save Xeven777/c10b66434910274dd5a51e9b04ab3cca to your computer and use it in GitHub Desktop.
Zshrc steup with autocomplete+suggestions+starship+zoxide
# 1. ENVIRONMENT & PATH
export NVM_DIR="$HOME/.config/nvm"
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Load local environment if present
[[ -f "$HOME/.local/bin/env" ]] && source "$HOME/.local/bin/env"
# 2. NVM LAZY LOADING (fast startup)
load_nvm() {
[[ -r "$NVM_DIR/nvm.sh" ]] || return
source "$NVM_DIR/nvm.sh"
[[ -r "$NVM_DIR/bash_completion" ]] && source "$NVM_DIR/bash_completion"
}
for cmd in nvm node npm npx yarn pnpm corepack; do
eval "$cmd() { unset -f $cmd; load_nvm; $cmd \"\$@\"; }"
done
# 3. HISTORY CONFIGURATION
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=10000
export SAVEHIST=10000
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
# 4. COMPLETION SYSTEM
zmodload zsh/complist
autoload -Uz compinit
compinit -d "${ZDOTDIR:-$HOME}/.zcompdump"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' menu select
# 5. ALIASES
alias ls='ls --color=auto --group-directories-first'
alias ll='ls -lhF'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias reload='source ~/.zshrc'
alias ni='npm install'
alias nr='npm run'
alias nd='npm run dev'
alias nb='npm run build'
alias bi='bun install'
alias br='bun run'
alias bd='bun run dev'
alias bb='bun run build'
alias c='code'
alias g='geany'
alias -s {html,htm}=xdg-open
alias -s {js,ts,jsx,tsx,json,css}=code
alias cls='clear'
# 6. KEY BINDINGS
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^R' history-incremental-search-backward
# 7. DIRECTORY BEHAVIOR
setopt AUTO_CD
chpwd() {
emulate -L zsh
ls -CF
}
# 8. PLUGINS
# Autosuggestions
[[ -f "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" ]] \
&& source "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
# Syntax highlighting (must load after autosuggestions)
[[ -f "$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] \
&& source "$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
# Zoxide (smart cd)
eval "$(zoxide init zsh)"
# 9. PROMPT (must be last)
eval "$(starship init zsh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment