Starship/fr: Difference between revisions

From NixOS Wiki
Nyxar77 (talk | contribs)
Created page with "Après avoir modifié votre configuration, appliquez les modifications en exécutant:"
Tags: Mobile edit Mobile web edit
Nyxar77 (talk | contribs)
Created page with "=== en utilisant Home Configuration ==="
Tags: Mobile edit Mobile web edit
Line 28: Line 28:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Using_Home_Configuration"></span>
=== Using Home Configuration ===
=== en utilisant Home Configuration ===
</div>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">

Revision as of 12:10, 25 October 2024

Starship is a fast, customizable, and minimal prompt for any shell. written in Rust, It displays relevant information like the current directory, Git status, runtime versions, and more, adapting to the context with minimal configuration. It supports multiple shells, including Bash, Zsh, Fish, PowerShell and a lot of other shells, and your configuration will stay persistent across all these shells and is designed for speed and efficiency.

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 
];

After updating your configuration, apply the changes by running:

home-manager switch

Configuration

Basic

  programs.starship.enable = true; #enable starship

after you have installed starship you need to source it in your 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

Advanced

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