β‘οΈ Workflow: Zsh installeren en configureren met Zim¶
Deze gids helpt je bij het installeren van Zsh, het instellen als standaard shell, en het configureren met Zim (een snel en eenvoudig Zsh-framework met themaβs en modules).
βΉοΈ Wat is Zsh?¶
Zsh (Z Shell) is een uitgebreide shell voor Unix/Linux en macOS. Het is een alternatief voor de standaard Bash-shell en biedt meer functionaliteiten zoals:
- betere tab-completion
- spelling/autocorrect
- handige prompt-tweaks
- krachtige scripting mogelijkheden
- themaβs en plugins
Zsh is populair in combinatie met frameworks (zoals Oh My Zsh of Zim) die het nog krachtiger en gebruiksvriendelijker maken.
βΉοΈ Wat is Zim?¶
Zim is een lichtgewicht, snel framework voor Zsh.
Het zorgt ervoor dat je gemakkelijk:
- themaβs kunt instellen voor je prompt
- modules (plugins) kunt activeren, zoals syntax highlighting, autosuggestions en history search
- je shell eenvoudig kunt uitbreiden zonder zelf scripts te beheren
π Kortom: Zsh = de shell, en Zim = het framework om Zsh uit te breiden.
πΉ 1. Installeer Zsh¶
Op Ubuntu/Debian:
Op macOS (via Homebrew):
πΉ 2. Start Zsh¶
Je kunt direct in Zsh starten met:
πΉ 3. Installeer Zim¶
Gebruik curl om Zim te installeren:
Na installatie zie je dat er automatisch een default thema is ingesteld.
πΉ 4. Zet Zsh als standaard shell¶
Wijzig de standaard shell van je gebruiker:
Controleer of dit gelukt is met:
Voorbeeld output:
Daarmee is bevestigd dat de login-shell nu zsh is.
πΉ 5. Configuratie in ~/.zimrc¶
Open het configuratiebestand:
Voeg je modules en thema toe na de regel:
Bijvoorbeeld:
zmodule completion
zmodule prompt
zmodule syntax-highlighting
zmodule autosuggestions
zmodule history-substring-search
πΉ 6. Modules installeren¶
Installeer de gekozen modules:
Voorbeeld output:
Herstart daarna je terminal. Je ziet nu dat alle modules en het thema actief zijn.
πΉ 7. Autocorrectie instellen¶
Open ~/.zshrc:
Zoek de regel:
Verwijder het # en zorg dat er staat:
Sla op en sluit af.
πΉ 8. Werking van autocorrect¶
Typ je een fout commando, dan zie je:
yβ Voert het correcte commando uit.nof Enter β Laat de fout staan.
β Samenvatting¶
- Installeren Zsh:
sudo apt install zshofbrew install zsh - Starten:
zsh - Zim installeren:
curl ... | zsh - Default shell:
chsh -s $(which zsh)β check met/etc/passwd - Modules toevoegen: in
~/.zimrc - Modules installeren:
zimfw install - Autocorrect activeren:
setopt CORRECTin~/.zshrc