aboutsummaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'zsh')
-rw-r--r--zsh/zprofile130
-rw-r--r--zsh/zshenv26
-rw-r--r--zsh/zshrc252
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
3if [[ ! -d "${HISTFILE:h}" ]]; then 3if [[ ! -d "${HISTFILE:h}" ]]; then
4 mkdir -p "${HISTFILE:h}" 4 mkdir -p "${HISTFILE:h}"
5fi 5fi
6 6
7add_path() { 7add_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
13set_include_lib_path() { 13set_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
21add_path "$HOME/.cargo/bin" 21add_path "$HOME/.cargo/bin"
22add_path "$HOME/.local/bin" 22add_path "$HOME/.local/bin"
23 23
24case "$OSTYPE" in 24case "$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 ;;
42esac 42esac
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
46export KEYBOARD_KEY_TIMEOUT_US=1000 46export 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
50export TMUXP_CONFIGDIR="$XDG_CONFIG_HOME/tmuxp" 50export 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
54export VIT_DIR="$XDG_CONFIG_HOME/vit" 54export VIT_DIR="$XDG_CONFIG_HOME/vit"
55 55
56# Maildir für mu (mail-utils) 56# Maildir für mu (mail-utils)
57export MAILDIR="$HOME/Mail" 57export MAILDIR="$HOME/Mail"
58 58
59# mpd starten 59# mpd starten
60if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then 60if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then
61 /usr/local/bin/musicpd 61 /usr/local/bin/musicpd
62fi 62fi
63 63
64unfunction add_path 64unfunction add_path
65unfunction set_include_lib_path 65unfunction set_include_lib_path
diff --git a/zsh/zshenv b/zsh/zshenv
index 9ddbb8c..bddab8b 100644
--- a/zsh/zshenv
+++ b/zsh/zshenv
@@ -1,13 +1,13 @@
1# vim: filetype=zsh 1# vim: filetype=zsh
2 2
3export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" 3export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
4export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" 4export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
5export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" 5export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
6 6
7export EDITOR="nvim" 7export EDITOR="nvim"
8export VISUAL="nvim" 8export VISUAL="nvim"
9 9
10export HISTSIZE=10000 10export HISTSIZE=10000
11export SAVEHIST=10000 11export SAVEHIST=10000
12export HISTFILE="$XDG_DATA_HOME/zsh/history" 12export HISTFILE="$XDG_DATA_HOME/zsh/history"
13 13
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