Files
dotfiles/bsd.zshrc
T
2026-05-11 06:22:04 +00:00

92 lines
2.6 KiB
Bash

# Fastfetch
sleep 0.1 && fastfetch --config ~/.config/fastfetch/fastfetch.jsonc
# --- P10k Instant Prompt ---
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# --- Zinit Setup ---
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"
# --- Plugins ---
zinit ice depth=1; zinit light romkatv/powerlevel10k
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-autosuggestions
zinit snippet OMZ::plugins/git/git.plugin.zsh
zinit load 'zsh-users/zsh-history-substring-search'
autoload -Uz compinit && compinit
zinit cdreplay -q
# --- Theme & Fastfetch ---
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
bindkey -e
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey "^[[3~" delete-char
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
# Shift + Pfeiltasten (verhindert A, B, C, D Ausgabe)
bindkey '^[[1;2A' up-line-or-history # Hoch
bindkey '^[[1;2B' down-line-or-history # Runter
bindkey '^[[1;2C' forward-char # Rechts
bindkey '^[[1;2D' backward-char # Links
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
setopt autocd
setopt auto_param_slash
setopt globdots
# --- Environment ---
export EDITOR='nvim'
export VISUAL='nvim'
export TERM='xterm-256color'
# Entferne das '/' aus der Definition eines Wortes
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
# --- Aliases ---
alias c='clear'
alias x='exit'
alias yay='yay --noconfirm'
# Check ob eza installiert ist, sonst ls fallback
if (( $+commands[eza] )); then
alias l='eza -lagh --group-directories-first'
else
alias l='ls -lah --color=always --group-directories-first'
fi
# --- Update Script ---
update_system() {
if (( $+commands[flatpak] )); then
echo "--- Flatpak Update ---"
flatpak update -y && flatpak uninstall --unused -y
fi
echo "--- System Update ---"
sudo pkg update && sudo pkg upgrade -y
}
alias u='update_system'