Outils pour utilisateurs

Outils du site


article:installer_oh-my-zsh

Ceci est une ancienne révision du document !


Installer oh-my-zsh

Info

Largement inspiré de https://aymeric-cucherousset.fr/installer-zsh-sur-debian-11/ https://gist.github.com/n1snt/454b879b8f0b7995740ae04c5fb5b7df

oh-my-zsh est un complément fort utile pour l'environnement zsh

[ "$USER" = "root" ] && apt -y update && apt -y install git curl zsh fonts-powerline unzip
 
bash -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
 
export ZSH="$HOME/.oh-my-zsh"
 
# autosuggesions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH/plugins/zsh-autosuggestions
 
# zsh-syntax-highlighting plugin
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/plugins/zsh-syntax-highlighting
 
# zsh-history-substring-search plugin
git clone https://github.com/zsh-users/zsh-history-substring-search $ZSH/custom/plugins/zsh-history-substring-search
# zsh-autocomplete plugin
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH/plugins/zsh-autocomplete

Attention

Activer les plugins en adaptant .zshrc

# Trouver  
    plugins=(git)
# Remplacer par 
    plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search zsh-autocomplete)

Exemple

Exemple de contenu style “titux” du fichier .zshrc

  • ! Attention !
    Le code suivant permet de créer le fichier .zshtc pour configurer zsh si ce fichier ~/.zshrc n'existe pas déjà …
[ -e ~/.zshrc ] && {
  echo "Le fichier  ~/.zshrc existe donc pas de création de ce fichier...
Si vous souhaitez le suppimmer passez la commande :  rm ~/.zshrc"
} || { 
cat << EOF >~/.zshrc 
 
export ZSH="$HOME/.oh-my-zsh"
#
ZSH_THEME="agnoster"
#
zstyle ':omz:update' mode reminder  # just remind me to update when it's time
plugins=(git colored-man-pages zsh-navigation-tools zsh-autosuggestions)
#
source $ZSH/oh-my-zsh.sh
#
#
## alias ###########################################################################
##----------------------------------------------------------------------------------
#
alias la="/bin/ls -lah"
alias ll="/bin/ls -lh"
alias  l="/bin/ls -A"
alias rm="/bin/rm -i"
alias cp="/bin/cp -i"
alias mv="/bin/mv -i"
alias  f="/bin/clear"
#
## Compilation flags ###############################################################
##----------------------------------------------------------------------------------
export LANG=fr_FR.UTF-8
export LANGUAGE=fr_FR
export ARCHFLAGS="-arch x86_64"
EOF
 
clear
echo "Pour faire en sorte que **zsh** devienne votre "shell" par défaut passez la commande : chsh -s $(which zsh)
"
}
article/installer_oh-my-zsh.1705051761.txt.gz · Dernière modification : 2024/01/12 10:29 de estro