Zsh
De Linuxmemo.
(Différences entre les versions)
(→Utilisation) |
(→Utilisation) |
||
Ligne 31 : | Ligne 31 : | ||
==Utilisation== | ==Utilisation== | ||
- | + | ===changement de rep via menu=== | |
<tab> + <tab> + flèches | <tab> + <tab> + flèches | ||
- | + | ===complétion sur path=== | |
cd /u/lo/sh <Tab> ( deviens /usr/local/share ) | cd /u/lo/sh <Tab> ( deviens /usr/local/share ) | ||
- | + | ===les alias=== | |
-='cd -' | -='cd -' | ||
...=../.. | ...=../.. | ||
Ligne 53 : | Ligne 53 : | ||
9='cd -9' | 9='cd -9' | ||
- | + | ===dernière commande=== | |
début de la commande déjà tapée + flèche haute (puis remonter dans l'historique) | début de la commande déjà tapée + flèche haute (puis remonter dans l'historique) | ||
- | + | ===remplacement de variable=== | |
${HOME} + <Tab> | ${HOME} + <Tab> | ||
/home/user | /home/user | ||
- | + | ===options des commandes=== | |
kill - <Tab> | kill - <Tab> | ||
- | + | ===recherche de fichiers par filtre=== | |
*(<filtre>) | *(<filtre>) | ||
**/*(<filtre>) | **/*(<filtre>) | ||
Ligne 69 : | Ligne 69 : | ||
http://zsh.sourceforge.net/Doc/Release/Expansion.html#Filename-Generation | http://zsh.sourceforge.net/Doc/Release/Expansion.html#Filename-Generation | ||
- | + | ===identifiants de commande=== | |
kill + <Tab> <Tab> | kill + <Tab> <Tab> | ||
fonctionne avec jobs bg ... | fonctionne avec jobs bg ... | ||
- | + | ===historique des commandes=== | |
!! | !! | ||
!-2 | !-2 | ||
!-3 | !-3 |
Version du 5 juillet 2018 à 09:13
Sommaire |
Install
apt-get install zsh chsh -s /bin/zsh
Config
~/.zshrc
"oh-my-zsh"
.zshrc tout prèt et ultra complet (thèmes, plugins...)
- url site
- install
via curl sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" via wget sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Clonage Git dans '/home/user/.oh-my-zsh'... Looking for an existing zsh config... Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh Using the Oh My Zsh template file and adding it to ~/.zshrc Copying your current PATH and adding it to the end of ~/.zshrc for you. Time to change your default shell to zsh!
- Acitivation des Thèmes et des plugins
Via ~/.zshrc
- liste des thèmes
https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
- Liste des plugins
https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
Utilisation
<tab> + <tab> + flèches
complétion sur path
cd /u/lo/sh <Tab> ( deviens /usr/local/share )
les alias
-='cd -' ...=../.. ....=../../.. .....=../../../.. ......=../../../../.. 1='cd -' 2='cd -2' 3='cd -3' 4='cd -4' 5='cd -5' 6='cd -6' 7='cd -7' 8='cd -8' 9='cd -9'
dernière commande
début de la commande déjà tapée + flèche haute (puis remonter dans l'historique)
remplacement de variable
${HOME} + <Tab> /home/user
options des commandes
kill - <Tab>
recherche de fichiers par filtre
*(<filtre>) **/*(<filtre>) ls **/*(mh-1)
http://zsh.sourceforge.net/Doc/Release/Expansion.html#Filename-Generation
identifiants de commande
kill + <Tab> <Tab> fonctionne avec jobs bg ...
historique des commandes
!! !-2 !-3