Starship

Revision as of 06:47, 8 October 2025 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Starship est un prompt rapide, personnalisable et minimal pour n'importe quel shell. Écrit en Rust, il affiche des informations pertinentes comme le répertoire actuel, le statut Git, les versions d'exécution, et plus encore, s'adaptant au contexte avec une configuration minimale. Il prend en charge plusieurs shells, y compris Bash, Zsh, Fish, PowerShell et de nombreux autres shells, et votre configuration restera persistante sur tous ces shells, tout en étant conçue pour la rapidité et l'efficacité.

Installation

en utilisant nix-shell

nix-shell -p starship

en utilisant Global Configuration

environment.systemPackages = [
  pkgs.starship
];

Après avoir modifié votre configuration, appliquez les modifications en exécutant:

sudo nixos-rebuild switch

en utilisant Home Configuration

home.packages = [ 
  pkgs.starship 
];

Après avoir modifié votre configuration, appliquez les modifications en exécutant:

home-manager switch

Configuration

Basique

programs.starship.enable = true;

après avoir installé Starship, vous devez le sourcer dans votre shell

Bash:

eval "$(starship init bash)"

Zsh:

eval "$(starship init zsh)"

Fish:

starship init fish | source

if you use other shells than what I just mentioned please head to this page

Avancé

you can customize starship with Nix (here's a snippet to understand) :

programs.starship = {
  enable = true;
  settings = {
    add_newline = true;
    command_timeout = 1300;
    scan_timeout = 50;
    format = "$all$nix_shell$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status\n$username$hostname$directory";
    character = {
      success_symbol = "[](bold green) ";
      error_symbol = "[✗](bold red) ";
    };
  };
};

since we can't include every option on Starship here's a GitHub link containing every configuration option and here's the official documentation to explain each option starship configuration guide

good luck :D