Starship: Difference between revisions
No edit summary |
m "Home Configuration" -> "Home Manager", capitalize Starship |
||
| (11 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
<!--T:1--> | |||
<!--T:1--> | [https://starship.rs/ Starship] is a fast, customizable, and minimal prompt for any shell. It is written in Rust and 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] is a fast, customizable, and minimal prompt for any shell. written in Rust | |||
== Installation == <!--T:2--> | == Installation == <!--T:2--> | ||
=== Using nix-shell === <!--T:3--> | === Using nix-shell === <!--T:3--> | ||
</translate> | |||
<syntaxhighlight lang="bash" start="3"> | <syntaxhighlight lang="bash" start="3"> | ||
nix-shell -p starship | nix-shell -p starship | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
=== Using Global Configuration === <!--T:4--> | === Using Global Configuration === <!--T:4--> | ||
</translate> | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
environment.systemPackages = [ | environment.systemPackages = [ | ||
| Line 23: | Line 22: | ||
]; | ]; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:37--> | |||
<!--T: | |||
After modifying your configuration, apply the changes by running: | After modifying your configuration, apply the changes by running: | ||
</translate> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo nixos-rebuild switch | sudo nixos-rebuild switch | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
=== Using Home Manager === <!--T:5--> | |||
</translate> | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
home.packages = [ | home.packages = [ | ||
| Line 42: | Line 41: | ||
]; | ]; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T: | <!--T:38--> | ||
After updating your configuration, apply the changes by running: | After updating your configuration, apply the changes by running: | ||
</translate> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
home-manager switch | home-manager switch | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
== Configuration == <!--T:6--> | |||
=== Basic === <!--T:7--> | |||
=== Basic === <!--T: | |||
</translate> | </translate> | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
programs.starship.enable = true; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:39--> | <!--T:39--> | ||
after you have installed | after you have installed Starship you need to source it in your shell | ||
<!--T:45--> | |||
Bash: | |||
</translate> | </translate> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
eval "$(starship init bash)" | eval "$(starship init bash)" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | |||
<!--T:46--> | |||
Zsh: | |||
</translate> | |||
<syntaxhighlight lang="zsh"> | <syntaxhighlight lang="zsh"> | ||
eval "$(starship init zsh)" | eval "$(starship init zsh)" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | |||
<!--T:47--> | |||
Fish: | |||
</translate> | |||
<syntaxhighlight lang="fish"> | <syntaxhighlight lang="fish"> | ||
starship init fish | source | starship init fish | source | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:10--> | <!--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: | === Advanced === <!--T:8--> | ||
<!--T:12--> | <!--T:12--> | ||
you can customize | you can customize Starship with Nix (here's a snippet to understand) | ||
<nowiki>:</nowiki> | <nowiki>:</nowiki> | ||
</translate> | </translate> | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
programs.starship = { | 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) "; | |||
}; | |||
}; | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:13--> | <!--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 <noinclude> [https://gist.github.com/s-a-c/0e44dc7766922308924812d4c019b109#file-starship-nix/ containing every configuration option] </noinclude> 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/ | |||
<!--T:15--> | <!--T:15--> | ||
good luck | good luck :D | ||
<!--T:48--> | |||
[[Category:Shell]] | [[Category:Shell]] | ||
</translate> | |||