# 🚀 Installation automatique de Zsh avec Powerlevel10k pour Debian 12 Script d'installation complet et idempotent pour configurer un environnement Zsh moderne et productif sur Debian 12. ![Zsh Version](https://img.shields.io/badge/Zsh-5.9+-green) ![Debian](https://img.shields.io/badge/Debian-12-red) ![License](https://img.shields.io/badge/license-MIT-blue) ## ✹ FonctionnalitĂ©s Ce script installe et configure automatiquement : - ✅ **Zsh** - Shell moderne et puissant - ✅ **Oh My Zsh** - Framework de gestion de configuration - ✅ **Powerlevel10k** - ThĂšme ultra-rapide et personnalisable - ✅ **Polices Nerd Fonts** (MesloLGS NF) - Pour un affichage parfait des icĂŽnes - ✅ **Plugins essentiels** - AutocomplĂ©tion, coloration, historique amĂ©liorĂ© - ✅ **Outils modernes** - fzf, ripgrep, bat, exa, fd-find ## 📩 Plugins installĂ©s ### Plugins externes (via Git) | Plugin | Description | |--------|-------------| | **zsh-autosuggestions** | Suggestions basĂ©es sur l'historique (→ pour accepter) | | **zsh-syntax-highlighting** | Coloration syntaxique des commandes | | **zsh-completions** | Autocompletions supplĂ©mentaires | | **zsh-history-substring-search** | Recherche dans l'historique avec ↑/↓ | | **fzf-tab** | ComplĂ©tion interactive avec prĂ©visualisation | ### Plugins Oh My Zsh intĂ©grĂ©s - `git` - Aliases Git (gs, ga, gc, gp, gl...) - `docker` - AutocomplĂ©tion Docker - `docker-compose` - AutocomplĂ©tion Docker Compose - `sudo` - Double ESC pour prĂ©fixer avec sudo - `history` - Gestion avancĂ©e de l'historique - `colored-man-pages` - Pages man colorĂ©es - `command-not-found` - Suggestions de paquets ## đŸ› ïž Outils supplĂ©mentaires - **fzf** - Recherche floue interactive (Ctrl+R) - **ripgrep** - Recherche ultra-rapide dans les fichiers - **fd-find** - Alternative moderne Ă  `find` - **bat** - `cat` avec coloration syntaxique - **exa** - `ls` amĂ©liorĂ© avec icĂŽnes et couleurs ## 📋 PrĂ©requis - Debian 12 (Bookworm) - AccĂšs root ou sudo - Connexion internet ## 🚀 Installation ### Installation rapide ```bash # TĂ©lĂ©charger le script wget https://raw.giteausercontent.com/Johnny/Install_zsh/main/install_zsh.sh # Rendre le script exĂ©cutable chmod +x install_zsh.sh # ExĂ©cuter pour l'utilisateur actuel sudo ./install_zsh.sh # Ou pour un utilisateur spĂ©cifique sudo ./install_zsh.sh username ``` ### Installation via Git ```bash git clone https://git.h3campus.fr/Johnny/Install_zsh.git cd Install_zsh chmod +x install_zsh.sh sudo ./install_zsh.sh ``` ## ⚙ Post-installation 1. **DĂ©connectez-vous et reconnectez-vous** pour activer Zsh 2. Au premier lancement, **l'assistant de configuration Powerlevel10k** se lance automatiquement 3. Suivez les instructions pour personnaliser votre prompt ### Reconfigurer Powerlevel10k ```bash p10k configure ``` ### Configuration SSH Si vous utilisez SSH, configurez votre terminal local pour utiliser la police **MesloLGS NF** : - **Windows Terminal** : Settings → Profiles → Defaults → Appearance → Font face → MesloLGS NF - **iTerm2** : Preferences → Profiles → Text → Font → MesloLGS NF - **VS Code** : Settings → Terminal â€ș Integrated: Font Family → MesloLGS NF ## ⌚ Raccourcis clavier | Raccourci | Action | |-----------|--------| | `Ctrl + R` | Recherche floue dans l'historique (fzf) | | `↑` / `↓` | Recherche dans l'historique (substring) | | `→` | Accepter une suggestion | | `ESC` `ESC` | Ajouter sudo Ă  la commande | | `Tab` | ComplĂ©tion interactive avec prĂ©visualisation | ## 🎹 Aliases inclus ### GĂ©nĂ©ral ```bash ll # ls -lah avec exa si disponible la # ls -A tree # exa --tree (si exa installĂ©) cat # bat avec coloration (si bat installĂ©) ``` ### Git ```bash gs # git status ga # git add gc # git commit gp # git push gl # git log --oneline --graph --decorate ``` ### Docker ```bash dps # docker ps dpa # docker ps -a di # docker images dex # docker exec -it ``` ### Maintenance ```bash update-zsh # Mettre Ă  jour Oh My Zsh et tous les plugins zshconfig # Éditer ~/.zshrc ``` ## 🔄 Mise Ă  jour Pour mettre Ă  jour Oh My Zsh et tous les plugins : ```bash update-zsh ``` Ou manuellement : ```bash omz update cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions && git pull cd ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && git pull cd ~/.oh-my-zsh/custom/plugins/zsh-completions && git pull cd ~/.oh-my-zsh/custom/plugins/fzf-tab && git pull cd ~/.oh-my-zsh/custom/themes/powerlevel10k && git pull ``` ## đŸ’Ÿ Sauvegarde de la configuration ### Sauvegarder Powerlevel10k ```bash # Sauvegarde locale cp ~/.p10k.zsh ~/.p10k.zsh.backup # Sauvegarde datĂ©e cp ~/.p10k.zsh ~/p10k-backup-$(date +%Y%m%d).zsh ``` ### Sauvegarder .zshrc ```bash cp ~/.zshrc ~/.zshrc.backup ``` ### Synchroniser entre serveurs ```bash # Depuis le serveur source scp ~/.p10k.zsh ~/.zshrc user@serveur-destination:~/ # Ou avec Git (recommandĂ©) mkdir -p ~/dotfiles cp ~/.p10k.zsh ~/.zshrc ~/dotfiles/ cd ~/dotfiles git init git add . git commit -m "Initial dotfiles" git remote add origin https://github.com/USERNAME/dotfiles.git git push -u origin main ``` ## 🔧 Personnalisation ### Modifier les plugins Éditez `~/.zshrc` et modifiez la section `plugins=()` : ```bash plugins=( git docker # Ajoutez vos plugins ici ) ``` ### Ajouter des aliases personnalisĂ©s Ajoutez vos aliases Ă  la fin de `~/.zshrc` : ```bash alias mon-alias='ma-commande' ``` Puis rechargez : ```bash source ~/.zshrc # ou exec zsh ``` ## 🐛 DĂ©pannage ### Les icĂŽnes ne s'affichent pas correctement - VĂ©rifiez que votre terminal utilise la police **MesloLGS NF** - RedĂ©marrez votre terminal aprĂšs avoir changĂ© la police ### Zsh n'est pas le shell par dĂ©faut ```bash # VĂ©rifier le shell actuel echo $SHELL # Changer manuellement chsh -s $(which zsh) ``` ### Les suggestions sont lentes Ajoutez dans `~/.zshrc` : ```bash ZSH_AUTOSUGGEST_USE_ASYNC=true ``` ### DĂ©sactiver un plugin Éditez `~/.zshrc` et retirez le plugin de la liste, puis : ```bash source ~/.zshrc ``` ## 📝 Structure des fichiers ``` ~/ ├── .zshrc # Configuration principale Zsh ├── .p10k.zsh # Configuration Powerlevel10k ├── .oh-my-zsh/ # Framework Oh My Zsh │ └── custom/ │ ├── plugins/ # Plugins personnalisĂ©s │ │ ├── zsh-autosuggestions/ │ │ ├── zsh-syntax-highlighting/ │ │ ├── zsh-completions/ │ │ ├── zsh-history-substring-search/ │ │ └── fzf-tab/ │ └── themes/ │ └── powerlevel10k/ # ThĂšme Powerlevel10k └── .local/share/fonts/ # Polices MesloLGS NF ``` ## đŸ€ Contribution Les contributions sont les bienvenues ! N'hĂ©sitez pas Ă  : 1. Fork le projet 2. CrĂ©er une branche (`git checkout -b feature/amelioration`) 3. Commit vos changements (`git commit -m 'Ajout fonctionnalitĂ©'`) 4. Push vers la branche (`git push origin feature/amelioration`) 5. Ouvrir une Pull Request ## 📜 Licence Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de dĂ©tails. ## 🙏 Remerciements - [Oh My Zsh](https://ohmyz.sh/) - [Powerlevel10k](https://github.com/romkatv/powerlevel10k) - [zsh-users](https://github.com/zsh-users) pour les plugins - [Aloxaf](https://github.com/Aloxaf/fzf-tab) pour fzf-tab ## 📧 Support Si vous rencontrez des problĂšmes ou avez des questions : - Ouvrez une [issue](https://git.h3campus.fr/Johnny/Install_zsh/issues) - Consultez la [documentation Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh/wiki) - Consultez la [documentation Powerlevel10k](https://github.com/romkatv/powerlevel10k) Made with ❀ for the Zsh community