dotfiles/.zshrc
2025-08-18 19:28:10 +01:00

113 lines
3.8 KiB
Bash
Executable File

# Path to Oh My Zsh installation
export ZSH="$HOME/.oh-my-zsh"
# Set theme to powerlevel10k for a modern, customizable UI
ZSH_THEME="powerlevel10k/powerlevel10k"
# Enable plugins for functionality
plugins=(
git
dotenv
golang
docker
npm
rust
yarn
zsh-autosuggestions
zsh-history-substring-search
zsh-syntax-highlighting
)
# Source Oh My Zsh
source $ZSH/oh-my-zsh.sh
# Powerlevel10k configuration for dark theme with red accents
# Run `p10k configure` to customize or edit ~/.p10k.zsh
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Customize zsh-autosuggestions highlight style (red font, subtle background)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff5555,bg=#323232"
# LS_COLORS for file listings (red-focused for blue light filtering)
export LS_COLORS="di=1;31:fi=0;31:ln=0;31:pi=0;31:so=0;31:bd=0;31:cd=0;31:or=0;31:ex=0;32"
# History settings for better usability
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.zsh_history
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt SHARE_HISTORY
# Key bindings for history substring search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# Environment variables from your original config
export PATH=$PATH:/usr/lib/libvirt:/etc/libvirt:/usr/include/libvirt:/usr/share/libvirt
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/bin
export PATH=$PATH:/usr/local/sbin
export GOPRIVATE=gitea.urkob.com/urko
export PATH=$PATH:$HOME/make-4.4
export PATH=$PATH:$HOME/flutter/bin
export CHROME_EXECUTABLE=/usr/bin/brave
export PATH=$PATH:$HOME/.pub-cache/bin
export PATH=$PATH:$HOME/.dotnet
export PATH=$PATH:$HOME/.dotnet/tools
export DOTNET_ROOT=$HOME/.dotnet
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
export HOMEBREW_NO_ANALYTICS=1
export PATH="/opt/brew/sbin:$PATH"
# NVM setup
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Dotnet telemetry opt-out
export DOTNET_CLI_TELEMETRY_OPTOUT=1
# Git aliases
alias git-ci="git checkout"
alias git-prune-master="git checkout master && git pull origin master && git remote prune origin && git fetch origin"
alias git-prune-main="git checkout main && git pull origin main && git remote prune origin && git fetch origin"
# Password generator alias
alias mypwgen='pwgen -scny -r "\\" -r "\`" -r "\""'
# Prompt customization for blue light filter compatibility
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs time)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{#ff5555}➜ %f"
POWERLEVEL9K_DIR_FOREGROUND='red'
POWERLEVEL9K_VCS_FOREGROUND='red'
POWERLEVEL9K_STATUS_OK_FOREGROUND='red'
POWERLEVEL9K_STATUS_ERROR_FOREGROUND='red'
POWERLEVEL9K_TIME_FOREGROUND='red'
POWERLEVEL9K_BACKGROUND='black'
# Syntax highlighting colors (must be after sourcing zsh-syntax-highlighting)
ZSH_HIGHLIGHT_STYLES[default]="fg=#cc0000"
ZSH_HIGHLIGHT_STYLES[command]="fg=#cc0000,bold"
ZSH_HIGHLIGHT_STYLES[alias]="fg=#cc0000"
ZSH_HIGHLIGHT_STYLES[function]="fg=#cc0000"
ZSH_HIGHLIGHT_STYLES[path]="fg=#ff5555,underline"
ZSH_HIGHLIGHT_STYLES[globbing]="fg=#ff5555"
# Custom highlight rules for specific commands
ZSH_HIGHLIGHT_PATTERNS=('ls' 'fg=#cc0000,bold')
ZSH_HIGHLIGHT_PATTERNS=('exit' 'fg=#cc0000,bold')
# Auto-completion settings
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# Enable fzf for fuzzy finding (if installed)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh