From a599969f7a9276776931875532c90af881f2a292 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 2 Jan 2026 16:21:27 +0100 Subject: erster entwurf für eine neue zsh Konfiguration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/aliases | 5 ----- zsh/completion | 16 ---------------- zsh/prompt | 17 ----------------- zsh/zprofile | 3 +++ zsh/zshenv | 9 +++------ zsh/zshenv.home | 7 +++++++ zsh/zshrc | 43 ++++++++++++++++++++++++++++++++++++------- 7 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 zsh/aliases delete mode 100644 zsh/completion delete mode 100644 zsh/prompt create mode 100644 zsh/zprofile create mode 100644 zsh/zshenv.home (limited to 'zsh') diff --git a/zsh/aliases b/zsh/aliases deleted file mode 100644 index 7d56736..0000000 --- a/zsh/aliases +++ /dev/null @@ -1,5 +0,0 @@ -# vim: filetype=zsh - -alias mc='mc -u' -alias gdb='gdb -q' -alias pwgen='pwgen -s 48 1' diff --git a/zsh/completion b/zsh/completion deleted file mode 100644 index ce676bb..0000000 --- a/zsh/completion +++ /dev/null @@ -1,16 +0,0 @@ -# vim: filetype=zsh - -# Command completion -autoload -U compinit; compinit -_comp_options+=(globdots) # With hidden files - -zstyle ':completion:*' completer _extensions _complete _approximate - -zstyle ':completion:*' menu select - -zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' -zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' -zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' -zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' -zstyle ':completion:*' group-name '' - diff --git a/zsh/prompt b/zsh/prompt deleted file mode 100644 index f567bbe..0000000 --- a/zsh/prompt +++ /dev/null @@ -1,17 +0,0 @@ -# vim: filetype=zsh - -autoload -Uz vcs_info -precmd_vcs_info() { vcs_info } -precmd_functions+=( precmd_vcs_info ) -setopt prompt_subst - -RPROMPT=\$vcs_info_msg_0_ -PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' - -zstyle ':vcs_info:*' unstagedstr ' *' -zstyle ':vcs_info:*' stagedstr ' +' -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%a%u%c%F{3}|%F{1}%a%F{5}]%f' -zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' - diff --git a/zsh/zprofile b/zsh/zprofile new file mode 100644 index 0000000..34d71c1 --- /dev/null +++ b/zsh/zprofile @@ -0,0 +1,3 @@ +# vim: filetype=zsh + +[[ -d "${HISTFILE:h}" ]] || mkdir -p "${HISTFILE:h}" diff --git a/zsh/zshenv b/zsh/zshenv index 460d03e..34c81a1 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -1,15 +1,11 @@ -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CACHE_HOME="$HOME/.cache" +# vim: filetype=zsh export EDITOR="nvim" export VISUAL="nvim" -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" - -export HISTFILE="$XDG_DATA_HOME/zsh/history" export HISTSIZE=10000 export SAVEHIST=10000 +export HISTFILE="$XDG_DATA_HOME/zsh/history" HOME_LOCAL="$HOME/.local/bin" HOME_CARGO="$HOME/.cargo/bin" @@ -20,6 +16,7 @@ export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man:$HOME/.local/texli export INFOPATH="$INFOPATH:$HOME/.local/texlive/texmf-dist/info" # Fix Midnight Commander ESC Taste +# zusätzlich noch unter "F9 -> Optionen -> Konfiguration -> Escape Tastenmodus -> [x] Einzelner Tastendruck" aktivieren export KEYBOARD_KEY_TIMEOUT_US=1000 # Tmuxp diff --git a/zsh/zshenv.home b/zsh/zshenv.home new file mode 100644 index 0000000..47f9687 --- /dev/null +++ b/zsh/zshenv.home @@ -0,0 +1,7 @@ +# vim: filetype=zsh + +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" diff --git a/zsh/zshrc b/zsh/zshrc index 036b90a..7845c40 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,5 +1,4 @@ -# Aliase -source $XDG_CONFIG_HOME/zsh/aliases +# vim: filetype=zsh # Optionen setopt AUTO_PARAM_SLASH @@ -8,15 +7,11 @@ setopt HIST_SAVE_NO_DUPS [[ ! -r /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] || source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh [[ ! -r /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] || source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh -[[ ! -r ~/.opam/opam-init/init.zsh ]] || source ~/.opam/opam-init/init.zsh +[[ ! -r "$HOME/.opam/opam-init/init.zsh" ]] || source "$HOME/.opam/opam-init/init.zsh" bindkey -v export KEYTIMEOUT=1 -fpath=($XDG_CONFIG_HOME/zsh $fpath) -autoload -Uz prompt; prompt -autoload -Uz completion; completion - # Keybindings zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char @@ -36,3 +31,37 @@ bindkey -M visual S add-surround bindkey '^A' vi-beginning-of-line bindkey '^E' vi-end-of-line +# Aliase +alias mc='mc -u' +alias gdb='gdb -q' +alias pwgen='pwgen -s 48 1' + +# Command completion +autoload -U compinit; compinit +_comp_options+=(globdots) # With hidden files + +zstyle ':completion:*' completer _extensions _complete _approximate + +zstyle ':completion:*' menu select + +zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' +zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' +zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' +zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' +zstyle ':completion:*' group-name '' + +# Prompt +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +setopt prompt_subst + +RPROMPT=\$vcs_info_msg_0_ +PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' + +zstyle ':vcs_info:*' unstagedstr ' *' +zstyle ':vcs_info:*' stagedstr ' +' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%a%u%c%F{3}|%F{1}%a%F{5}]%f' +zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -- cgit v1.3