aboutsummaryrefslogtreecommitdiff
path: root/zsh/zshrc
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-08-12 09:19:03 +0200
committerThomas Schmucker <ts@its1.de>2026-08-12 09:19:03 +0200
commit6e5882a2fd02d30206ab9ca8aa5847b8ea09196c (patch)
tree75d3b91f9005e51b93a37b44f3ad23ce4f48bc35 /zsh/zshrc
parent41c676453cd32fac760ff26e092c9dc81874739f (diff)
downloaddotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.tar.gz
dotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.tar.bz2
dotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.zip
Normalize line endings
Diffstat (limited to 'zsh/zshrc')
-rw-r--r--zsh/zshrc252
1 files changed, 126 insertions, 126 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index 6f31eaa..b636dcd 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,126 +1,126 @@
1# vim: filetype=zsh 1# vim: filetype=zsh
2 2
3# Hooks 3# Hooks
4chpwd() { 4chpwd() {
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
21source_if_exists() { 21source_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
28setopt AUTO_PARAM_SLASH 28setopt AUTO_PARAM_SLASH
29unsetopt CASE_GLOB 29unsetopt CASE_GLOB
30setopt HIST_SAVE_NO_DUPS 30setopt HIST_SAVE_NO_DUPS
31setopt INC_APPEND_HISTORY 31setopt INC_APPEND_HISTORY
32setopt SHARE_HISTORY 32setopt SHARE_HISTORY
33setopt HIST_IGNORE_ALL_DUPS 33setopt HIST_IGNORE_ALL_DUPS
34setopt HIST_IGNORE_SPACE 34setopt HIST_IGNORE_SPACE
35 35
36source_if_exists "$HOME/.opam/opam-init/init.zsh" 36source_if_exists "$HOME/.opam/opam-init/init.zsh"
37 37
38case "$OSTYPE" in 38case "$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 ;;
47esac 47esac
48 48
49if (( ${+ZSH_HIGHLIGHT_STYLES} )); then 49if (( ${+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'
52fi 52fi
53 53
54bindkey -v 54bindkey -v
55export KEYTIMEOUT=1 55export KEYTIMEOUT=1
56 56
57# Keybindings 57# Keybindings
58zmodload zsh/complist 58zmodload zsh/complist
59bindkey -M menuselect 'h' vi-backward-char 59bindkey -M menuselect 'h' vi-backward-char
60bindkey -M menuselect 'k' vi-up-line-or-history 60bindkey -M menuselect 'k' vi-up-line-or-history
61bindkey -M menuselect 'l' vi-forward-char 61bindkey -M menuselect 'l' vi-forward-char
62bindkey -M menuselect 'j' vi-down-line-or-history 62bindkey -M menuselect 'j' vi-down-line-or-history
63 63
64autoload -Uz surround 64autoload -Uz surround
65zle -N delete-surround surround 65zle -N delete-surround surround
66zle -N add-surround surround 66zle -N add-surround surround
67zle -N change-surround surround 67zle -N change-surround surround
68bindkey -M vicmd cs change-surround 68bindkey -M vicmd cs change-surround
69bindkey -M vicmd ds delete-surround 69bindkey -M vicmd ds delete-surround
70bindkey -M vicmd ys add-surround 70bindkey -M vicmd ys add-surround
71bindkey -M visual S add-surround 71bindkey -M visual S add-surround
72 72
73bindkey '^A' vi-beginning-of-line 73bindkey '^A' vi-beginning-of-line
74bindkey '^E' vi-end-of-line 74bindkey '^E' vi-end-of-line
75 75
76# Aliase 76# Aliase
77alias mc='mc -u' 77alias mc='mc -u'
78alias gdb='gdb -q' 78alias gdb='gdb -q'
79alias pwgen='pwgen -s 48 1' 79alias pwgen='pwgen -s 48 1'
80alias ls='ls -G' 80alias ls='ls -G'
81 81
82# Funktionen 82# Funktionen
83nvim-update() { 83nvim-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
91autoload -U compinit 91autoload -U compinit
92compinit 92compinit
93_comp_options+=(globdots) # With hidden files 93_comp_options+=(globdots) # With hidden files
94 94
95# ... Angular CLI 95# ... Angular CLI
96if (( $+commands[ng] )); then 96if (( $+commands[ng] )); then
97 . <(ng completion script) 97 . <(ng completion script)
98fi 98fi
99 99
100zstyle ':completion:*' completer _extensions _complete _approximate 100zstyle ':completion:*' completer _extensions _complete _approximate
101 101
102zstyle ':completion:*' menu select 102zstyle ':completion:*' menu select
103 103
104zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' 104zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
105zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f' 105zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
106zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f' 106zstyle ':completion:*:*:*:*:messages' format ' %F{purple} -- %d --%f'
107zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f' 107zstyle ':completion:*:*:*:*:warnings' format ' %F{red}-- no matches found --%f'
108zstyle ':completion:*' group-name '' 108zstyle ':completion:*' group-name ''
109 109
110# Prompt 110# Prompt
111autoload -Uz vcs_info 111autoload -Uz vcs_info
112precmd_vcs_info() { vcs_info } 112precmd_vcs_info() { vcs_info }
113precmd_functions+=( precmd_vcs_info ) 113precmd_functions+=( precmd_vcs_info )
114setopt prompt_subst 114setopt prompt_subst
115 115
116RPROMPT=\$vcs_info_msg_0_ 116RPROMPT=\$vcs_info_msg_0_
117PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b ' 117PROMPT=$'[%F{green}%8>..>%n%>>%F{white}@%F{green}%8>..>%m%>>%F{white}] %F{white}%(4~|.../%3~|%~) %B%F{blue}>%f%b '
118 118
119zstyle ':vcs_info:*' unstagedstr ' *' 119zstyle ':vcs_info:*' unstagedstr ' *'
120zstyle ':vcs_info:*' stagedstr ' +' 120zstyle ':vcs_info:*' stagedstr ' +'
121zstyle ':vcs_info:*' check-for-changes true 121zstyle ':vcs_info:*' check-for-changes true
122zstyle ':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' 122zstyle ':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'
123zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f' 123zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%u%c%F{5}]%f'
124zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' 124zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
125 125
126unfunction source_if_exists 126unfunction source_if_exists