5.5 KiB
5.5 KiB
🚀 Configuration Starship (Windows & Linux)
Ce dépôt contient un fichier starship.toml prêt à l’emploi pour personnaliser votre terminal avec Starship.
📥 Installation de Starship
🔹 Windows
-
Installer Starship via winget :
winget install --id Starship.Starship -e -
Activer Starship dans PowerShell :
-
Ouvrir le profil PowerShell :
notepad $PROFILE -
Coller le bloc suivant puis enregistrer :
# Ouvrir/éditer le profil : # notepad $PROFILE # --- Qualité de vie --- [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() Import-Module PSReadLine -ErrorAction SilentlyContinue Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -EditMode Windows # --- Starship --- Invoke-Expression (& starship init powershell) # ======================= # Aliases / Fonctions # ======================= # e. -> ouvrir l'explorateur dans le dossier courant function e { param($path='.') Start-Process explorer $path } Set-Alias e. e # si ça gêne, supprime cette ligne et appelle simplement `e` # glog -> git log joli + args pass-through function glog { git log --oneline --all --graph --decorate @args } # ls -> déjà alias de Get-ChildItem en PS ; variantes utiles : function ll { Get-ChildItem -Force } function la { Get-ChildItem -Force -Hidden } # clear -> nettoyer l'écran Set-Alias clear Clear-Host # up / down -> docker compose function up { docker compose up -d @args } function down { docker compose down @args } # run -> serveur PHP local function run { php -S localhost:80 @args } # term -> shell dans le conteneur `php-web` function term { docker exec -it php-web bash @args } # tests -> PHPUnit function tests { & 'vendor\bin\phpunit' 'tests\' --colors=always --testdox @args }
📋 Liste des alias et fonctions ajoutées
Alias / Fonction Commande associée Description e. explorer .Ouvre l’explorateur Windows dans le dossier courant glog git log --oneline --all --graph --decorateHistorique Git compact et lisible ll Get-ChildItem -ForceListe fichiers, y compris cachés la Get-ChildItem -Force -HiddenListe tous les fichiers, même cachés et système clear Clear-HostNettoie l’écran du terminal up docker compose up -dLance Docker Compose en arrière-plan down docker compose downArrête les conteneurs Docker run php -S localhost:80Démarre un serveur PHP local term docker exec -it php-web bashShell dans le conteneur php-webtests vendor\bin\phpunit tests\ --colors=always --testdoxExécute PHPUnit avec sortie lisible -
-
Relancer Windows Terminal.
🔹 Linux (Ubuntu / Debian / autres distros)
-
Installer Starship :
-
Script officiel (toutes distros) :
curl -sS https://starship.rs/install.sh | sh -
Ou via gestionnaire de paquets si disponible :
# Debian/Ubuntu sudo apt install starship -y # Fedora sudo dnf install starship -y # Arch sudo pacman -S starship
-
-
Activer Starship dans votre shell :
- Bash (
~/.bashrc) :eval "$(starship init bash)" - Zsh (
~/.zshrc) :eval "$(starship init zsh)" - Fish (
~/.config/fish/config.fish) :starship init fish | source
- Bash (
-
Relancer le shell.
⚙️ Télécharger et copier le fichier starship.toml
Au lieu de copier manuellement, vous pouvez directement récupérer le fichier avec :
Linux / WSL
curl -fsSL https://git.eldunar.fr/TonyLight/Starship.git/raw/branch/main/starship.toml -o ~/.config/starship.toml
ou
wget -O ~/.config/starship.toml https://git.eldunar.fr/TonyLight/Starship.git/raw/branch/main/starship.toml
Windows PowerShell
iwr -useb https://git.eldunar.fr/TonyLight/Starship.git/raw/branch/main/starship.toml | Out-File -Encoding utf8 "$env:USERPROFILE\.config\starship.toml"
🔡 Police recommandée
Pour afficher correctement les icônes et glyphes Nerd Fonts, installez : DejaVu Sans Mono Nerd Font
- Téléchargement : https://www.nerdfonts.com/font-downloads
- Après installation, sélectionnez la police dans votre terminal (Windows Terminal, Alacritty, Kitty, etc.) :
DejaVuSansMono Nerd Font
✅ Une fois ces étapes suivies, relancez votre terminal → vous aurez un prompt stylisé et homogène entre Windows et Linux.