From 5de3767093a794f0ba0613e4f927d46663da75e4 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 9 May 2026 18:24:21 +0000 Subject: [PATCH] =?UTF-8?q?bsd.zshrc=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsd.zshrc | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 bsd.zshrc diff --git a/bsd.zshrc b/bsd.zshrc new file mode 100644 index 0000000..0b77790 --- /dev/null +++ b/bsd.zshrc @@ -0,0 +1,76 @@ +# --- 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 + +# --- Environment --- +export EDITOR='nvim' +export VISUAL='nvim' +export TERM='xterm-256color' + +# Entferne das '/' aus der Definition eines Wortes +WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' + +# --- Zinit Setup --- +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" +if [ ! -d "$ZINIT_HOME" ]; then + mkdir -p "$(dirname $ZINIT_HOME)" + git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" +fi +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 +# Fastfetch erst nach dem Prompt-Setup aufrufen +(( $+commands[fastfetch] )) && fastfetch --config ~/.config/fastfetch/config.jsonc + +# --- History & Options --- +HISTSIZE=5000 +HISTFILE=~/.zsh_history +SAVEHIST=$HISTSIZE +setopt appendhistory sharehistory hist_ignore_space hist_ignore_all_dups +setopt hist_save_no_dups hist_ignore_dups hist_find_no_dups +setopt autocd auto_param_slash globdots + +# --- Aliases --- +alias c='clear' +alias x='exit' + +# 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' + +# Keybindings +bindkey -e +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word +bindkey "^[[3~" delete-char +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down \ No newline at end of file