### 前置要求
- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal.
### 快速安装
1. 安装 **starship** 二进制文件:
#### 安装最新版本
使用 Shell 命令:
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration.
#### 通过软件包管理器安装
使用 [Homebrew](https://brew.sh/):
```sh
brew install starship
```
使用 [Scoop](https://scoop.sh):
```powershell
scoop install starship
```
1. 将初始化脚本添加到您的 shell 的配置文件:
#### Bash
在 `~/.bashhrc` 的最后,添加以下内容:
```sh
# ~/.bashrc
eval "$(starship init bash)"
```
#### Fish
在 `~/.config/fish/config.fish` 的最后,添加以下内容:
```sh
# ~/.config/fish/config.fish
starship init fish | source
```
#### Zsh
在 `~/.zshrc` 的最后,添加以下内容:
```sh
# ~/.zshrc
eval "$(starship init zsh)"
```
#### Powershell
将以下内容添加到 `Microsoft.PowerShell_profile.ps1`。 你可以在 PowerShell 通过 `$PROFILE` 变量来查询文件的位置。 对于 -Nix 来说,通常文件路径是 `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` 或 `~/.config/powershell/Microsoft.PowerShell_profile.ps1`。
```sh
Invoke-Expression (&starship init powershell)
```
#### Ion
在 `~/.config/ion/initrc` 的最后,添加以下内容:
```sh
# ~/.config/ion/initrc
eval $(starship init ion)
```
#### Elvish
::: warning Only elvish v0.15 or higher is supported. :::
Add the following to the end of `~/.elvish/rc.elv`:
```sh
# ~/.elvish/rc.elv
eval (starship init elvish)
```
#### Tcsh
Add the following to the end of `~/.tcshrc`:
```sh
# ~/.tcshrc
eval `starship init tcsh`
```
#### Nushell
::: warning This will change in the future. Only nu version v0.33 or higher is supported. ::: Add the following to your nu config file. You can check the location of this file by running `config path` in nu.
```toml
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu"
]
prompt = "starship_prompt"
```