logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).


L'icône rouge permet de télécharger chaque page du wiki visitée au format PDF et la grise au format ODT → ODT PDF Export

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
utilisateurs:kawer:tutos:ohmyzsh [02/03/2020 10:08]
kawer créée
utilisateurs:kawer:tutos:ohmyzsh [23/01/2022 20:53] (Version actuelle)
kawer [Configuration]
Ligne 1: Ligne 1:
-====== zsh - ohmyzsh ======+====== zsh - ohmyzsh ​- Powerlevel10k ​======
  
-  * Objet : Personnalisation du shell ZSH - ohmyzsh +  * Objet : Personnalisation du shell ZSH - ohmyzsh ​- Powerlevel10k 
-  * Niveau requis : FIXME {{tag>​débutant avisé}} +  * Niveau requis : {{tag>​débutant avisé}} 
-  * Commentaires : // goodies //+  * Commentaires : // shell, ​goodies //
   * Débutant, à savoir : [[:​doc:​systeme:​commandes:​le_debianiste_qui_papillonne|Utiliser GNU/Linux en ligne de commande, tout commence là !.]] :-)   * Débutant, à savoir : [[:​doc:​systeme:​commandes:​le_debianiste_qui_papillonne|Utiliser GNU/Linux en ligne de commande, tout commence là !.]] :-)
  
 ===== Introduction ===== ===== Introduction =====
-Amélioration du shell zsh avec ohmyzsh, coloration syntaxique, suggestions des commandes depuis l'​historique ...+Amélioration du shell zsh avec ohmyzsh ​et powerlevel10k, coloration syntaxique, suggestions des commandes depuis l'​historique ...
  
 ===== Installation ===== ===== Installation =====
 +==== Prérequis ====
 +<code root>apt update && apt install git curl zsh fonts-powerline unzip</​code>​
  
-<code root>apt update && apt install fonts-powerline git curl zsh</​code>​ +==== OhMyZsh ==== 
-<code user>sh -c "​$(curl -fsSL https://​raw.github.com/​robbyrussell/oh-my-zsh/​master/​tools/​install.sh)"</​code>​+ 
 +Récupération et installation du framework : 
 +<code user>sh -c "​$(curl -fsSL https://​raw.github.com/​ohmyzsh/ohmyzsh/​master/​tools/​install.sh)"</​code>​
  
 <​code>​--info 'Do you want to change your default shell to zsh? [Y/n]' Y, Enter <​code>​--info 'Do you want to change your default shell to zsh? [Y/n]' Y, Enter
Ligne 18: Ligne 22:
 </​code>​ </​code>​
  
 +=== Plugin additionnel ===
 +
 +//​Prédiction basé sur les commandes contenu dans le .zsh_history ://
 +<code user>git clone https://​github.com/​zsh-users/​zsh-autosuggestions ~/​.oh-my-zsh/​custom/​plugins/​zsh-autosuggestions</​code>​
 +//​Coloration Syntaxique ://
 +<code user>git clone https://​github.com/​zsh-users/​zsh-syntax-highlighting ~/​.oh-my-zsh/​custom/​plugins/​zsh-syntax-highlighting</​code>​
 +
 +==== PowerLevel10k ====
 +
 +Récupération du thème :
 +<code user>git clone --depth=1 https://​github.com/​romkatv/​powerlevel10k.git ${ZSH_CUSTOM:​-$HOME/​.oh-my-zsh/​custom}/​themes/​powerlevel10k</​code>​
 ===== Configuration ===== ===== Configuration =====
 +
 +==== OhMyZsh ====
 +Aux choix de l'​éditeur texte, par exemple avec nano :
 <code user>​nano ~/​.zshrc</​code>​ <code user>​nano ~/​.zshrc</​code>​
  
-**-Ajouter ceci en première ligne :**+ 
 +Ajouter ceci en première ligne :
 <​code>​export TERM="​xterm-256color"</​code>​ <​code>​export TERM="​xterm-256color"</​code>​
  
-**-Cherchez : ZSH_THEME="​robbyrussell" ​et remplacer par : ** +La section / lignes ​ZSH_THEME="​xxx" ​est à remplacer par : 
-<​code>​ZSH_THEME="​powerlevel9k/powerlevel9k"</​code>​+<​code>​ZSH_THEME="​powerlevel10k/powerlevel10k"</​code>​
  
-**-Idem avec : plugins=(git) :**+La section / lignes ​plugins=“xxx” est à remplacer par :
 <​code>​plugins=( <​code>​plugins=(
         zsh-autosuggestions         zsh-autosuggestions
Ligne 34: Ligne 53:
         git         git
         )         )
-</​code>​ 
- 
-**-Puis à la fin de votre fichier pour un laptop :** 
-<​code>​POWERLEVEL9K_CUSTOM_DEBIAN_ICON="​echo -e '​\uf306'​ " 
-POWERLEVEL9K_CUSTOM_DEBIAN_ICON_BACKGROUND=233 
-POWERLEVEL9K_CUSTOM_DEBIAN_ICON_FOREGROUND=010 
- 
-POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_debian_icon root_indicator dir dir_writable) 
-POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time battery) 
- 
-POWERLEVEL9K_PROMPT_ON_NEWLINE=true 
-POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="​\u256d\u2500 " 
-POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="​\u2570\ue0c0 " 
- 
-POWERLEVEL9K_PROMPT_ADD_NEWLINE=true 
- 
-POWERLEVEL9K_TIME_FORMAT="​%D{\ue383 %H:%M \uf073 %d.%m.%y}"​ 
- 
-POWERLEVEL9K_BATTERY_CHARGING='​yellow'​ 
-POWERLEVEL9K_BATTERY_CHARGED='​green'​ 
-POWERLEVEL9K_BATTERY_DISCONNECTED='​$DEFAULT_COLOR'​ 
-POWERLEVEL9K_BATTERY_LOW_THRESHOLD='​10'​ 
-POWERLEVEL9K_BATTERY_LOW_COLOR='​red'​ 
-POWERLEVEL9K_BATTERY_ICON='​\uf1e6 ' 
-</​code>​ 
- 
-**-Puis à la fin de votre fichier pour un desktop :** 
-<​code>​ 
-POWERLEVEL9K_CUSTOM_DEBIAN_ICON="​echo -e '​\uf306'​ " 
-POWERLEVEL9K_CUSTOM_DEBIAN_ICON_BACKGROUND=233 
-POWERLEVEL9K_CUSTOM_DEBIAN_ICON_FOREGROUND=010 
- 
-POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_debian_icon root_indicator dir dir_writable) 
-POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time) 
- 
-POWERLEVEL9K_PROMPT_ON_NEWLINE=true 
-POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="​\u256d\u2500 " 
-POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="​\u2570\ue0c0 " 
- 
-POWERLEVEL9K_PROMPT_ADD_NEWLINE=true 
- 
-POWERLEVEL9K_TIME_FORMAT="​%D{\ue383 %H:%M \uf073 %d.%m.%y}"​ 
 </​code>​ </​code>​
  
 **-Prise en charge des glyphe :** **-Prise en charge des glyphe :**
-<code user>​wget https://​github.com/​ryanoasis/​nerd-fonts/​releases/​download/​v2.0.0/​Hack.zip</​code>​+<code user>​wget https://​github.com/​ryanoasis/​nerd-fonts/​releases/​download/​v2.1.0/​Hack.zip</​code>​
 <code user>​mkdir hack</​code>​ <code user>​mkdir hack</​code>​
 <code user>​unzip Hack.zip -d hack</​code>​ <code user>​unzip Hack.zip -d hack</​code>​
Ligne 89: Ligne 66:
 </​note>​ </​note>​
  
-===== Astuce ​===== +==== PowerLevel10k ​====
---Selon votre distrib ou vos envies, vous pouvez personnaliser le logo (custom_debian_icon) en récupérant le code ici : https://​www.nerdfonts.com/​cheat-sheet +
-Une fois fait, ajoutez après '​\u'​ votre code donc par exemple pour ubuntu remplacer le '​\uf306'​ (debian) si dessus par '​\ufa47'​ (ubuntu)+
  
---Avec les deux lignes suivant custom_debian_icon vous avez background et foreground, à personnaliser avec la commande suivante dans un shell zsh : +A venir .. 
-<​code>​for code ({000..255}) print -P -- "​$code:​%F{$code}Couleur : \uf445\uf445\uf445"</​code>​ +===== Astuce =====
-Choisissez un nombre correspondant à la couleur de votre choix et changez la valeurs des lignes POWERLEVEL9K indiqué plus haut. +
  
-**Prise en compte des modifications .zshrc :**+Prise en compte des modifications .zshrc :
 <code user>​source ~/​.zshrc</​code>​ <code user>​source ~/​.zshrc</​code>​
utilisateurs/kawer/tutos/ohmyzsh.1583140116.txt.gz · Dernière modification: 02/03/2020 10:08 par kawer

Pied de page des forums

Propulsé par FluxBB