ZSH
Installation
sudo apt install zsh
Standard-Konfiguration installieren
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Plugins
Core-Plugins (bereits in Oh My Zsh enthalten)
-
git
-
gcloud
-
kubectl
-
terraform
-
aliases
zsh-autosuggestions
Vervollständigt Kommandos wie bei der Shell Fish
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
kube-ps1
Wofür kube-ps1?
Wofür kube-ps1?
kube-ps1
ist ein kleines Helferlein für die Shell, das dir den aktuellen Kubernetes-Kontext direkt in deiner Prompt-Zeile anzeigt.
Stell dir vor: du bist auf mehreren Clustern unterwegs – vielleicht ein Test-Cluster, ein Staging-Cluster und die heilige Production. Mit kubectl config use-context …
wechselst du hin und her. Da kann es fatal sein, wenn du den Überblick verlierst und plötzlich ein kubectl delete
im falschen Cluster ausführst.
Genau hier springt kube-ps1
ein:
-
Es hängt an deinem Prompt eine Info wie
-
(⎈ |my-cluster:default)
-
→ ⎈ ist das Kubernetes-Symbol (Helm).
→my-cluster
ist dein aktueller Cluster (Context).
→default
ist das aktuelle Namespace. -
Beispiel-Prompt:
-
user@host (⎈ |prod:default) $
- Du kannst es auch anpassen, z. B. Farben für bestimmte Cluster setzen (rot für „production“), damit du sofort siehst, wo du gerade bist.
git clone https://github.com/jonmosco/kube-ps1.git ~/.oh-my-zsh/custom/plugins/kube-ps1
Plugins in Konfiguration eintragen
nano ~/.zshrc
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git)
plugins=(git gcloud kubectl kube-ps1 aliases terraform zsh-autosuggestions zsh-syntax-highlighting)
Änderungen übernehmen
source ~/.zshrc
Themen
(nach jeder Änderung muss zsh neu gestartet werden)
Übersicht der Themen https://github.com/ohmyzsh/ohmyzsh/wiki/themes
z.B. Powerlevel10k
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Aktivieren der Themen
nano ~/.zshrc
In der Zeile 12 kann das Thema hineingeschrieben werden
z.B.
ZSH_THEME="powerlevel10k/powerlevel10k"
Nur Powerlevel10k lässt sich konfigurieren. Z.B. wie die Symbole aussehen sollen etc.
p10k configure
ZSH zur Standard Shell machen
chsh -s /bin/zsh
No comments to display
No comments to display