diff options
Diffstat (limited to 'zsh/zshrc')
| -rw-r--r-- | zsh/zshrc | 44 |
1 files changed, 44 insertions, 0 deletions
| @@ -80,6 +80,25 @@ alias pwgen='pwgen -s 48 1' | |||
| 80 | alias ls='ls -G' | 80 | alias ls='ls -G' |
| 81 | 81 | ||
| 82 | # Funktionen | 82 | # Funktionen |
| 83 | pkg-update() { | ||
| 84 | case "$OSTYPE" in | ||
| 85 | darwin*) | ||
| 86 | brew update && brew upgrade | ||
| 87 | ;; | ||
| 88 | freebsd*) | ||
| 89 | doas pkg update && doas pkg upgrade | ||
| 90 | ;; | ||
| 91 | *) | ||
| 92 | print -u2 "pkg-update: kein Paketmanager für $OSTYPE hinterlegt" | ||
| 93 | return 1 | ||
| 94 | ;; | ||
| 95 | esac | ||
| 96 | } | ||
| 97 | |||
| 98 | npm-update() { | ||
| 99 | npm update -g --loglevel=info | ||
| 100 | } | ||
| 101 | |||
| 83 | nvim-update() { | 102 | nvim-update() { |
| 84 | nvim --headless \ | 103 | nvim --headless \ |
| 85 | -c "lua require[[lazy]].sync({ wait = true })" \ | 104 | -c "lua require[[lazy]].sync({ wait = true })" \ |
| @@ -87,6 +106,31 @@ nvim-update() { | |||
| 87 | -c "qa" | 106 | -c "qa" |
| 88 | } | 107 | } |
| 89 | 108 | ||
| 109 | pkg-clean() { | ||
| 110 | case "$OSTYPE" in | ||
| 111 | darwin*) | ||
| 112 | brew autoremove | ||
| 113 | ;; | ||
| 114 | freebsd*) | ||
| 115 | doas pkg autoremove | ||
| 116 | ;; | ||
| 117 | *) | ||
| 118 | print -u2 "pkg-clean: kein Paketmanager für $OSTYPE hinterlegt" | ||
| 119 | return 1 | ||
| 120 | ;; | ||
| 121 | esac | ||
| 122 | } | ||
| 123 | |||
| 124 | system-update() { | ||
| 125 | pkg-update || return | ||
| 126 | npm-update || return | ||
| 127 | nvim-update || return | ||
| 128 | |||
| 129 | if [[ "$1" == "--clean" ]]; then | ||
| 130 | pkg-clean | ||
| 131 | fi | ||
| 132 | } | ||
| 133 | |||
| 90 | # Command completion | 134 | # Command completion |
| 91 | autoload -U compinit | 135 | autoload -U compinit |
| 92 | compinit | 136 | compinit |
