From 817500961e10a84d7e669a6cc98bb59a5acc08a2 Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Thu, 4 Jun 2026 21:54:26 +0200 Subject: modify shell configs a little --- .zshrc | 102 +++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 41 deletions(-) (limited to '.zshrc') diff --git a/.zshrc b/.zshrc index a3ebfd4..91c2d40 100644 --- a/.zshrc +++ b/.zshrc @@ -1,74 +1,94 @@ -typeset -g ZSHRC_START=$(date +%s%3N) +fastfetch + +# Instant prompt (must stay near top) -source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -fastfetch -setopt interactivecomments +# Environment -eval `ssh-agent` -export PATH="$PATH:/home/spelis/.local/bin" -export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" - -HISTFILE=~/.histfile -HISTSIZE=100000 -SAVEHIST=100000 -export DEBUGINFOD_URLS="https://debuginfod.archlinux.org" +export PATH="$PATH:$HOME/.local/bin" -export SUDO_EDITOR="nvim" export EDITOR="nvim" +export SUDO_EDITOR="nvim" -autoload add-zsh-hook +export DEBUGINFOD_URLS="https://debuginfod.archlinux.org" +HISTFILE="$HOME/.histfile" +HISTSIZE=100000 +SAVEHIST=100000 + +setopt interactivecomments bindkey -e -export PATH=$PATH:/home/elis/.local/bin +# Programs -alias \ - yoink='yay -S' \ - yeet='yay -R' \ - x='exit' \ - cls='clear' \ - ls='eza -lh --group-directories-first --color=always --git --icons=auto' \ - tree='ls -T' \ - sudo='sudo -E' \ - cd='z' +# Use systemd/user-managed ssh-agent socket +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" + +# Completion autoload -Uz compinit compinit + zstyle ':completion:*' menu select zstyle ':completion:*' verbose yes -source <(fzf --zsh) -# setopt extendedglob +zstyle ':completion:*' completer \ + _complete \ + _ignored \ + _approximate \ + _list \ + _match \ + _prefix + +zstyle ':completion:*' matcher-list \ + 'm:{a-z}={A-Z}' \ + 'm:{A-Z}={a-z}' -# source "$HOME/.sdkman/bin/sdkman-init.sh" +zstyle ':completion:*' max-errors 3 prompt 'Errors: %e' +zstyle ':completion:*' menu select=long-list select +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache +zstyle ':completion:*' auto-description 'specify: %d' +zstyle ':completion:*' accept-exact '*(N)' + +# Plugins + +source <(fzf --zsh) eval "$(zoxide init zsh)" + source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -zstyle ':completion:*' completer _complete _ignored _approximate _list _match _prefix -zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'm:{A-Z}={a-z}' -zstyle ':completion:*' max-errors 3 prompt 'Errors: %e' -zstyle ':completion:*' menu select=long-list select -zstyle ':completion:*' use-cache on cache-path ~/.zsh/cache -zstyle ':completion:*' auto-description 'specify: %d' verbose yes accept-exact '*(N)' +# Aliases + +alias yoink='yay -S' +alias yeet='yay -R' +alias x='exit' +alias cls='clear' + +alias ls='eza -lh --group-directories-first --color=always --git --icons=auto' +alias tree='eza -T -lh --group-directories-first --git --icons=auto' + +alias sudo='sudo -E' +alias cd='z' + +# Functions mkcd() { mkdir -p "$1" && cd "$1" } -function command_title() { - printf '\033]0;%s\007' "$1" +command_title() { + printf '\033]0;%s\007' "$1" } +autoload -Uz add-zsh-hook add-zsh-hook preexec command_title -source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme +# Prompt -typeset -g ZSHRC_END=$(date +%s%3N) -echo ".zshrc load time: $((ZSHRC_END - ZSHRC_START)) ms" +source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh -- cgit v1.3-7-ge9ab