diff options
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/zprofile | 130 | ||||
| -rw-r--r-- | zsh/zshenv | 26 | ||||
| -rw-r--r-- | zsh/zshrc | 252 |
3 files changed, 204 insertions, 204 deletions
diff --git a/zsh/zprofile b/zsh/zprofile index 7fed3a7..3288e8d 100644 --- a/zsh/zprofile +++ b/zsh/zprofile | |||
| @@ -1,65 +1,65 @@ | |||
| 1 | # vim: filetype=zsh | 1 | # vim: filetype=zsh |
| 2 | 2 | ||
| 3 | if [[ ! -d "${HISTFILE:h}" ]]; then | 3 | if [[ ! -d "${HISTFILE:h}" ]]; then |
| 4 | mkdir -p "${HISTFILE:h}" | 4 | mkdir -p "${HISTFILE:h}" |
| 5 | fi | 5 | fi |
| 6 | 6 | ||
| 7 | add_path() { | 7 | add_path() { |
| 8 | if [[ -d "$1" ]]; then | 8 | if [[ -d "$1" ]]; then |
| 9 | path=("$1" $path) | 9 | path=("$1" $path) |
| 10 | fi | 10 | fi |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | set_include_lib_path() { | 13 | set_include_lib_path() { |
| 14 | # Fix für include/lib Verzeichnisse | 14 | # Fix für include/lib Verzeichnisse |
| 15 | # Details: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html | 15 | # Details: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html |
| 16 | export C_INCLUDE_PATH="$1/include:$C_INCLUDE_PATH" | 16 | export C_INCLUDE_PATH="$1/include:$C_INCLUDE_PATH" |
| 17 | export CPLUS_INCLUDE_PATH="$1/include:$CPLUS_INCLUDE_PATH" | 17 | export CPLUS_INCLUDE_PATH="$1/include:$CPLUS_INCLUDE_PATH" |
| 18 | export LIBRARY_PATH="$1/lib:$LIBRARY_PATH" | 18 | export LIBRARY_PATH="$1/lib:$LIBRARY_PATH" |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | add_path "$HOME/.cargo/bin" | 21 | add_path "$HOME/.cargo/bin" |
| 22 | add_path "$HOME/.local/bin" | 22 | add_path "$HOME/.local/bin" |
| 23 | 23 | ||
| 24 | case "$OSTYPE" in | 24 | case "$OSTYPE" in |
| 25 | darwin*) | 25 | darwin*) |
| 26 | add_path "/opt/homebrew/bin" | 26 | add_path "/opt/homebrew/bin" |
| 27 | 27 | ||
| 28 | set_include_lib_path "/opt/homebrew" | 28 | set_include_lib_path "/opt/homebrew" |
| 29 | ;; | 29 | ;; |
| 30 | freebsd*) | 30 | freebsd*) |
| 31 | texlive_prefix="$HOME/.local/texlive" | 31 | texlive_prefix="$HOME/.local/texlive" |
| 32 | 32 | ||
| 33 | if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then | 33 | if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then |
| 34 | add_path "$texlive_prefix/bin/amd64-freebsd" | 34 | add_path "$texlive_prefix/bin/amd64-freebsd" |
| 35 | 35 | ||
| 36 | export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" | 36 | export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" |
| 37 | export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" | 37 | export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" |
| 38 | fi | 38 | fi |
| 39 | 39 | ||
| 40 | set_include_lib_path "/usr/local" | 40 | set_include_lib_path "/usr/local" |
| 41 | ;; | 41 | ;; |
| 42 | esac | 42 | esac |
| 43 | 43 | ||
| 44 | # Fix Midnight Commander ESC Taste | 44 | # Fix Midnight Commander ESC Taste |
| 45 | # zusätzlich noch unter "F9 -> Optionen -> Konfiguration -> Escape Tastenmodus -> [x] Einzelner Tastendruck" aktivieren | 45 | # zusätzlich noch unter "F9 -> Optionen -> Konfiguration -> Escape Tastenmodus -> [x] Einzelner Tastendruck" aktivieren |
| 46 | export KEYBOARD_KEY_TIMEOUT_US=1000 | 46 | export KEYBOARD_KEY_TIMEOUT_US=1000 |
| 47 | 47 | ||
| 48 | # Tmuxp | 48 | # Tmuxp |
| 49 | # https://tmuxp.git-pull.com/configuration/environmental-variables.html | 49 | # https://tmuxp.git-pull.com/configuration/environmental-variables.html |
| 50 | export TMUXP_CONFIGDIR="$XDG_CONFIG_HOME/tmuxp" | 50 | export TMUXP_CONFIGDIR="$XDG_CONFIG_HOME/tmuxp" |
| 51 | 51 | ||
| 52 | # Vit (Taskwarrior UI) | 52 | # Vit (Taskwarrior UI) |
| 53 | # https://github.com/vit-project/vit/blob/2.x/CUSTOMIZE.md | 53 | # https://github.com/vit-project/vit/blob/2.x/CUSTOMIZE.md |
| 54 | export VIT_DIR="$XDG_CONFIG_HOME/vit" | 54 | export VIT_DIR="$XDG_CONFIG_HOME/vit" |
| 55 | 55 | ||
| 56 | # Maildir für mu (mail-utils) | 56 | # Maildir für mu (mail-utils) |
| 57 | export MAILDIR="$HOME/Mail" | 57 | export MAILDIR="$HOME/Mail" |
| 58 | 58 | ||
| 59 | # mpd starten | 59 | # mpd starten |
| 60 | if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then | 60 | if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then |
| 61 | /usr/local/bin/musicpd | 61 | /usr/local/bin/musicpd |
| 62 | fi | 62 | fi |
| 63 | 63 | ||
| 64 | unfunction add_path | 64 | unfunction add_path |
| 65 | unfunction set_include_lib_path | 65 | unfunction set_include_lib_path |
| @@ -1,13 +1,13 @@ | |||
| 1 | # vim: filetype=zsh | 1 | # vim: filetype=zsh |
| 2 | 2 | ||
| 3 | export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" | 3 | export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" |
| 4 | export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" | 4 | export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" |
| 5 | export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" | 5 | export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" |
| 6 | 6 | ||
| 7 | export EDITOR="nvim" | 7 | export EDITOR="nvim" |
| 8 | export VISUAL="nvim" | 8 | export VISUAL="nvim" |
| 9 | 9 | ||
| 10 | export HISTSIZE=10000 | 10 | export HISTSIZE=10000 |
| 11 | export SAVEHIST=10000 | 11 | export SAVEHIST=10000 |
| 12 | export HISTFILE="$XDG_DATA_HOME/zsh/history" | 12 | export HISTFILE="$XDG_DATA_HOME/zsh/history" |
| 13 | 13 | ||
| @@ -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 |
