diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:22:12 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:22:12 +0200 |
| commit | 189d244d36d4ebb2189b698adb21f51cf1c4176a (patch) | |
| tree | 3a6a9847dafabea051997b1a9cbc124a242ec1d3 /zsh/zshrc | |
| parent | 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c (diff) | |
| download | dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.tar.gz dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.tar.bz2 dotfiles-189d244d36d4ebb2189b698adb21f51cf1c4176a.zip | |
Revert "Normalize line endings"
This reverts commit 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.
Diffstat (limited to 'zsh/zshrc')
| -rw-r--r-- | zsh/zshrc | 252 |
1 files changed, 126 insertions, 126 deletions
| @@ -1,126 +1,126 @@ | |||
| 1 | # vim: filetype=zsh | 1 | # vim: filetype=zsh |
| 2 | 2 | ||
| 3 | # Hooks | 3 | # Hooks |
| 4 | chpwd() { | 4 | chpwd() { |
| 5 | if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then | 5 | if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then |
| 6 | local venv_dir="${VIRTUAL_ENV:h}" | 6 | local venv_dir="${VIRTUAL_ENV:h}" |
| 7 | if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then | 7 | if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then |
| 8 | deactivate | 8 | deactivate |
| 9 | fi | 9 | fi |
| 10 | fi | 10 | fi |
| 11 | 11 | ||
| 12 | for v in .venv venv .env; do | 12 | for v in .venv venv .env; do |
| 13 | if [[ -f "$v/bin/activate" ]]; then | 13 | if [[ -f "$v/bin/activate" ]]; then |
| 14 | . "$v/bin/activate" | 14 | . "$v/bin/activate" |
| 15 | break | 15 | break |
| 16 | fi | 16 | fi |
| 17 | done | 17 | done |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | # Funktionen | 20 | # Funktionen |
| 21 | source_if_exists() { | 21 | source_if_exists() { |
| 22 | if [[ -r "$1" ]]; then | 22 | if [[ -r "$1" ]]; then |
| 23 | . "$1" | 23 | . "$1" |
| 24 | fi | 24 | fi |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | # Optionen | 27 | # Optionen |
| 28 | setopt AUTO_PARAM_SLASH | 28 | setopt AUTO_PARAM_SLASH |
| 29 | unsetopt CASE_GLOB | 29 | unsetopt CASE_GLOB |
| 30 | setopt HIST_SAVE_NO_DUPS | 30 | setopt HIST_SAVE_NO_DUPS |
| 31 | setopt INC_APPEND_HISTORY | 31 | setopt INC_APPEND_HISTORY |
| 32 | setopt SHARE_HISTORY | 32 | setopt SHARE_HISTORY |
| 33 | setopt HIST_IGNORE_ALL_DUPS | 33 | setopt HIST_IGNORE_ALL_DUPS |
| 34 | setopt HIST_IGNORE_SPACE | 34 | setopt HIST_IGNORE_SPACE |
| 35 | 35 | ||
| 36 | source_if_exists "$HOME/.opam/opam-init/init.zsh" | 36 | source_if_exists "$HOME/.opam/opam-init/init.zsh" |
| 37 | 37 | ||
| 38 | case "$OSTYPE" in | 38 | case "$OSTYPE" in |
| 39 | darwin*) | 39 | darwin*) |
| 40 | source_if_exists "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" | 40 | source_if_exists "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" |
| 41 | source_if_exists "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" | 41 | source_if_exists "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" |
| 42 | ;; | 42 | ;; |
| 43 | freebsd*) | 43 | freebsd*) |
| 44 | source_if_exists "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" | 44 | source_if_exists "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" |
| 45 | source_if_exists "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" | 45 | source_if_exists "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" |
| 46 | ;; | 46 | ;; |
| 47 | esac | 47 | esac |
| 48 | 48 | ||
| 49 | if (( ${+ZSH_HIGHLIGHT_STYLES} )); then | 49 | if (( ${+ZSH_HIGHLIGHT_STYLES} )); then |
| 50 | ZSH_HIGHLIGHT_STYLES[path]='none' | 50 | ZSH_HIGHLIGHT_STYLES[path]='none' |
| 51 | ZSH_HIGHLIGHT_STYLES[path_prefix]='none' | 51 | ZSH_HIGHLIGHT_STYLES[path_prefix]='none' |
| 52 | fi | 52 | fi |
| 53 | 53 | ||
| 54 | bindkey -v | 54 | bindkey -v |
| 55 | export KEYTIMEOUT=1 | 55 | export KEYTIMEOUT=1 |
| 56 | 56 | ||
| 57 | # Keybindings | 57 | # Keybindings |
| 58 | zmodload zsh/complist | 58 | zmodload zsh/complist |
| 59 | bindkey -M menuselect 'h' vi-backward-char | 59 | bindkey -M menuselect 'h' vi-backward-char |
| 60 | bindkey -M menuselect 'k' vi-up-line-or-history | 60 | bindkey -M menuselect 'k' vi-up-line-or-history |
| 61 | bindkey -M menuselect 'l' vi-forward-char | 61 | bindkey -M menuselect 'l' vi-forward-char |
| 62 | bindkey -M menuselect 'j' vi-down-line-or-history | 62 | bindkey -M menuselect 'j' vi-down-line-or-history |
| 63 | 63 | ||
| 64 | autoload -Uz surround | 64 | autoload -Uz surround |
| 65 | zle -N delete-surround surround | 65 | zle -N delete-surround surround |
| 66 | zle -N add-surround surround | 66 | zle -N add-surround surround |
| 67 | zle -N change-surround surround | 67 | zle -N change-surround surround |
| 68 | bindkey -M vicmd cs change-surround | 68 | bindkey -M vicmd cs change-surround |
| 69 | bindkey -M vicmd ds delete-surround | 69 | bindkey -M vicmd ds delete-surround |
| 70 | bindkey -M vicmd ys add-surround | 70 | bindkey -M vicmd ys add-surround |
| 71 | bindkey -M visual S add-surround | 71 | bindkey -M visual S add-surround |
| 72 | 72 | ||
| 73 | bindkey '^A' vi-beginning-of-line | 73 | bindkey '^A' vi-beginning-of-line |
| 74 | bindkey '^E' vi-end-of-line | 74 | bindkey '^E' vi-end-of-line |
| 75 | 75 | ||
| 76 | # Aliase | 76 | # Aliase |
| 77 | alias mc='mc -u' | 77 | alias mc='mc -u' |
| 78 | alias gdb='gdb -q' | 78 | alias gdb='gdb -q' |
| 79 | alias pwgen='pwgen -s 48 1' | 79 | alias pwgen='pwgen -s 48 1' |
| 80 | alias ls='ls -G' | 80 | alias ls='ls -G' |
| 81 | 81 | ||
| 82 | # Funktionen | 82 | # Funktionen |
| 83 | nvim-update() { | 83 | nvim-update() { |
| 84 | nvim --headless \ | 84 | nvim --headless \ |
| 85 | -c "lua require[[lazy]].sync({ wait = true })" \ | 85 | -c "lua require[[lazy]].sync({ wait = true })" \ |
| 86 | -c "UpdateParsers" \ | 86 | -c "UpdateParsers" \ |
| 87 | -c "qa" | 87 | -c "qa" |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | # Command completion | 90 | # Command completion |
| 91 | autoload -U compinit | 91 | autoload -U compinit |
| 92 | compinit | 92 | compinit |
| 93 | _comp_options+=(globdots) # With hidden files | 93 | _comp_options+=(globdots) # With hidden files |
| 94 | 94 | ||
| 95 | # ... Angular CLI | 95 | # ... Angular CLI |
| 96 | if (( $+commands[ng] )); then | 96 | if (( $+commands[ng] )); then |
| 97 | . <(ng completion script) | 97 | . <(ng completion script) |
| 98 | fi | 98 | fi |
| 99 | 99 | ||
| 100 | zstyle ':completion:*' completer _extensions _complete _approximate | 100 | zstyle ':completion:*' completer _extensions _complete _approximate |
| 101 | 101 | ||
| 102 | zstyle ':completion:*' menu select | 102 | zstyle ':completion:*' menu select |
| 103 | 103 | ||
| 104 | zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' | 104 | zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' |
| 105 | zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' | 105 | zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' |
| 106 | zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' | 106 | zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' |
| 107 | zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' | 107 | zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' |
| 108 | zstyle ':completion:*' group-name '' | 108 | zstyle ':completion:*' group-name '' |
| 109 | 109 | ||
| 110 | # Prompt | 110 | # Prompt |
| 111 | autoload -Uz vcs_info | 111 | autoload -Uz vcs_info |
| 112 | precmd_vcs_info() { vcs_info } | 112 | precmd_vcs_info() { vcs_info } |
| 113 | precmd_functions+=( precmd_vcs_info ) | 113 | precmd_functions+=( precmd_vcs_info ) |
| 114 | setopt prompt_subst | 114 | setopt prompt_subst |
| 115 | 115 | ||
| 116 | RPROMPT=\$vcs_info_msg_0_ | 116 | RPROMPT=\$vcs_info_msg_0_ |
| 117 | PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' | 117 | PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' |
| 118 | 118 | ||
| 119 | zstyle ':vcs_info:*' unstagedstr ' *' | 119 | zstyle ':vcs_info:*' unstagedstr ' *' |
| 120 | zstyle ':vcs_info:*' stagedstr ' +' | 120 | zstyle ':vcs_info:*' stagedstr ' +' |
| 121 | zstyle ':vcs_info:*' check-for-changes true | 121 | zstyle ':vcs_info:*' check-for-changes true |
| 122 | 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' | 122 | 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' |
| 123 | zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' | 123 | zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' |
| 124 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' | 124 | zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' |
| 125 | 125 | ||
| 126 | unfunction source_if_exists | 126 | unfunction source_if_exists |
