Zsh: Unterschied zwischen den Versionen
Sysd0b (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „= zsh on Mac = Zsh ist ab Snow Leopard bereits von Haus aus mit dabei, wer eine aktuellere Version nutzen möchte kann dafür port benutzen. <pre> …“) |
Sysd0b (Diskussion | Beiträge) |
||
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | = | + | [[Kategorie:Mac]] |
− | Zsh ist ab | + | [[Kategorie:Programme]] |
− | + | ||
+ | Die Z-Shell ist eine sehr umfangreiche Unix-Shell, mehr dazu [https://de.wikipedia.org/wiki/Zsh hier] | ||
+ | |||
+ | = Zsh && OS X = | ||
+ | Zsh ist ab OS 10.6.5 bereits von Haus aus mit dabei, wer eine aktuellere Version nutzen möchte kann das mit [[Macports]] machen. | ||
<pre> | <pre> | ||
sudo port install zsh | sudo port install zsh | ||
</pre> | </pre> | ||
− | + | Pfad zur neuen Shell (/opt/local/bin/zsh) in die Datei ''/etc/shells'' setzen. | |
<pre> | <pre> | ||
sudo nano /etc/shells | sudo nano /etc/shells | ||
</pre> | </pre> | ||
+ | In die neue Shell wechseln | ||
+ | <pre> | ||
+ | chsh -s /opt/local/bin/zsh | ||
+ | </pre> | ||
+ | |||
+ | == Oh my Zsh == | ||
+ | [https://github.com/robbyrussell/oh-my-zsh Oh my Zsh] ist ein template Framework zum verwalten der Zsh Konfiguration. | ||
+ | |||
+ | Code bei github besorgen und im Home Verzeichnis speichern. | ||
+ | <pre> | ||
+ | git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | ||
+ | </pre> | ||
+ | Standard zsh-config sichern -> Orginal durch Oh_my_zsh-cfg ersetzen -> anpassen nach ermessen ;-) | ||
+ | <pre> | ||
+ | cp .zshrc .zshrc_backup | ||
+ | cp .oh-my-zsh/templates/zshrc.zsh-template .zshrc | ||
+ | nano .zshrc | ||
+ | </pre> | ||
+ | |||
+ | == Meine .zshrc == | ||
+ | <pre> | ||
+ | ## Path ++ | ||
+ | PATH=/opt/local/bin:$PATH # MacPorts | ||
+ | PATH=/opt/local/sbin:$PATH # MacPorts | ||
+ | PATH=/usr/local/bin:$PATH # User binaries | ||
+ | export PATH | ||
+ | |||
+ | ## Nach Eingabe von "cd" ein "ls" ausfuehren | ||
+ | function chpwd() { | ||
+ | emulate -LR zsh | ||
+ | ls -Cf | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | = Troubleshooting = | ||
+ | == add-zsh-hook: function definition file not found == | ||
+ | '''Fehlerbeschreibung: '''Beim start der zsh wird folgender fehler ausgegeben | ||
+ | <pre> | ||
+ | /Users/DEINBENUTZER/.oh-my-zsh/lib/termsupport.zsh:32: add-zsh-hook: function definition file not found | ||
+ | /Users/DEINBENUTZER/.oh-my-zsh/lib/termsupport.zsh:33: add-zsh-hook: function definition file not found | ||
+ | </pre> | ||
+ | |||
+ | '''Fehlerursache: '''War zu faul um code zu lesen oO | ||
+ | |||
+ | '''Fehlerbehebung: '''Ich habe die Datei ''.oh-my-zsh/lib/termsupport.zsh'' einfach zurückgesetzt, dank open source gibts ja öffentliche Backups | ||
+ | |||
+ | * https://raw.github.com/robbyrussell/oh-my-zsh/e3cede37a0ac1ef427fb07b6f79839b8c6a64780/lib/termsupport.zsh | ||
= Links = | = Links = | ||
* http://www.zsh.org/ | * http://www.zsh.org/ | ||
* https://de.wikipedia.org/wiki/Zsh | * https://de.wikipedia.org/wiki/Zsh | ||
+ | * http://seanmmcdaniel.com/2011/09/zsh-on-os-x/ |
Aktuelle Version vom 6. Mai 2012, 01:47 Uhr
Die Z-Shell ist eine sehr umfangreiche Unix-Shell, mehr dazu hier
Inhaltsverzeichnis
Zsh && OS X
Zsh ist ab OS 10.6.5 bereits von Haus aus mit dabei, wer eine aktuellere Version nutzen möchte kann das mit Macports machen.
sudo port install zsh
Pfad zur neuen Shell (/opt/local/bin/zsh) in die Datei /etc/shells setzen.
sudo nano /etc/shells
In die neue Shell wechseln
chsh -s /opt/local/bin/zsh
Oh my Zsh
Oh my Zsh ist ein template Framework zum verwalten der Zsh Konfiguration.
Code bei github besorgen und im Home Verzeichnis speichern.
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
Standard zsh-config sichern -> Orginal durch Oh_my_zsh-cfg ersetzen -> anpassen nach ermessen ;-)
cp .zshrc .zshrc_backup cp .oh-my-zsh/templates/zshrc.zsh-template .zshrc nano .zshrc
Meine .zshrc
## Path ++ PATH=/opt/local/bin:$PATH # MacPorts PATH=/opt/local/sbin:$PATH # MacPorts PATH=/usr/local/bin:$PATH # User binaries export PATH ## Nach Eingabe von "cd" ein "ls" ausfuehren function chpwd() { emulate -LR zsh ls -Cf }
Troubleshooting
add-zsh-hook: function definition file not found
Fehlerbeschreibung: Beim start der zsh wird folgender fehler ausgegeben
/Users/DEINBENUTZER/.oh-my-zsh/lib/termsupport.zsh:32: add-zsh-hook: function definition file not found /Users/DEINBENUTZER/.oh-my-zsh/lib/termsupport.zsh:33: add-zsh-hook: function definition file not found
Fehlerursache: War zu faul um code zu lesen oO
Fehlerbehebung: Ich habe die Datei .oh-my-zsh/lib/termsupport.zsh einfach zurückgesetzt, dank open source gibts ja öffentliche Backups