Starship: Difference between revisions

From NixOS Wiki
Nyxar77 (talk | contribs)
Marked this version for translation
Nyxar77 (talk | contribs)
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
 
<!--T:1-->
<!--T:1-->
[https://starship.rs/ 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''', [https://wiki.nixos.org/wiki/Zsh '''Zsh'''], [https://wiki.nixos.org/wiki/Fish '''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.
[https://starship.rs/ Starship] <translate> 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 </translate> '''Bash''', [https://wiki.nixos.org/wiki/Zsh '''Zsh'''], [https://wiki.nixos.org/wiki/Fish '''Fish'''], '''PowerShell''' <translate> and a lot of other shells, and your configuration will stay persistent across all these shells and is designed for speed and efficiency.


== Installation == <!--T:2-->
== Installation == <!--T:2-->
Line 24: Line 24:
<translate>
<translate>


<!--T:37-->
<!--T:5-->
After modifying your configuration, apply the changes by running:
After modifying your configuration, apply the changes by running:


Line 33: Line 33:
<translate>
<translate>


=== Using Home Configuration === <!--T:5-->
=== Using Home Configuration === <!--T:6-->


</translate>
</translate>
Line 42: Line 42:
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:38-->
<!--T:7-->
After updating your configuration, apply the changes by running:
After updating your configuration, apply the changes by running:


Line 51: Line 51:
<translate>
<translate>


== Configuration == <!--T:6-->
== Configuration == <!--T:8-->


=== Basic === <!--T:7-->
=== Basic === <!--T:9-->
</translate>
</translate>


Line 77: Line 77:
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:40-->
<!--T:10-->
if you use other shells than what I just mentioned please head to this [https://starship.rs/guide/#step-2-set-up-your-shell-to-use-starship page]
if you use other shells than what I just mentioned please head to this [https://starship.rs/guide/#step-2-set-up-your-shell-to-use-starship page]


=== Advanced === <!--T:8-->
=== Advanced === <!--T:11-->


<!--T:41-->
<!--T:12-->
you can customize starship with Nix (here's a snippet to understand)
you can customize starship with Nix (here's a snippet to understand)
<nowiki>:</nowiki>
<nowiki>:</nowiki>
Line 102: Line 102:
</syntaxhighlight>
</syntaxhighlight>
<translate>
<translate>
<!--T:42-->
<!--T:13-->
since we can't include every option on Starship here's a GitHub link [https://gist.github.com/s-a-c/0e44dc7766922308924812d4c019b109#file-starship-nix/ containing every configuration option]
since we can't include every option on Starship here's a GitHub link </translate> <noinclude> [https://gist.github.com/s-a-c/0e44dc7766922308924812d4c019b109#file-starship-nix/ containing every configuration option] </noinclude>
 
<translate>
<!--T:43-->
<!--T:14-->
and here's the official documentation to explain each option [https://starship.rs/config/ starship configuration guide]
and here's the official documentation to explain each option [https://starship.rs/config/ starship configuration guide]


<!--T:44-->
<!--T:15-->
good luck</translate> :D
good luck</translate> :D


[[Category:Shell]]
[[Category:Shell]]

Latest revision as of 13:30, 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

Using nix-shell

nix-shell -p starship

Using Global Configuration

environment.systemPackages = [
  pkgs.starship
];

After modifying your configuration, apply the changes by running:

sudo nixos-rebuild switch

Using 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