Files
starship/docs/zh-CN/installing/README.md
T

88 lines
2.0 KiB
Markdown
Raw Normal View History

2022-04-18 09:48:28 -05:00
# 高级安装
2021-01-07 18:08:18 -05:00
2023-04-11 13:05:27 +09:00
安装 Starship 需要两步:
2021-01-07 18:08:18 -05:00
2023-04-11 13:05:27 +09:00
1. 下载 **Starship** 的可执行文件
2. 修改 shell 的初始化脚本,将 Starship 设置为命令提示符
2021-01-07 18:08:18 -05:00
对大多数用户而言,按照[主页](../guide/#🚀-installation)上的步骤安装即可。 但有一些特殊系统上的安装步骤不同。 但有一些特殊系统上的安装步骤不同。
2021-01-07 18:08:18 -05:00
现有平台众多,README 中无法全部展示,所以这里是社区中对其他平台 的一些安装说明。 找不到你的平台? 如果你知道怎么安装,请添加到这里! 找不到你的平台? 如果你知道怎么安装,请添加到这里!
2021-03-15 13:18:42 -04:00
## [Chocolatey](https://chocolatey.org)
### 前置要求
2021-05-01 14:20:08 -04:00
按照 [Chocolatey 安装页面](https://chocolatey.org/install)上的步骤安装 Chocolatey。
2021-03-15 13:18:42 -04:00
2021-05-01 14:20:08 -04:00
### 安装
2021-03-15 13:18:42 -04:00
```powershell
choco install starship
```
2021-02-21 14:13:18 -05:00
## [termux](https://termux.com)
2021-03-15 13:18:42 -04:00
2021-05-01 14:20:08 -04:00
### 安装
2021-03-15 13:18:42 -04:00
2021-02-21 14:13:18 -05:00
```sh
2025-11-16 20:49:13 +09:00
pkg install starship
2021-02-21 14:13:18 -05:00
```
2021-01-07 18:08:18 -05:00
2021-11-07 18:07:39 +00:00
## [Funtoo Linux](https://www.funtoo.org/Welcome)
### 安装
2022-01-15 17:08:31 -05:00
在 Funtom Linux 上,可以通过 Portact 从 [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) 安装启动:
2021-11-07 18:07:39 +00:00
```sh
emerge app-shells/starship
```
2024-05-16 02:07:00 +09:00
## [Nix](https://wiki.nixos.org/wiki/Nix)
2021-01-07 18:08:18 -05:00
2022-01-15 17:08:31 -05:00
### 获取二进制文件
2021-01-07 18:08:18 -05:00
2022-01-15 17:08:31 -05:00
#### 命令
2021-01-07 18:08:18 -05:00
```sh
nix-env -iA nixos.starship
```
2023-04-11 13:05:27 +09:00
#### 声明式、单用户,使用 [home-manager](https://github.com/nix-community/home-manager)
2021-01-07 18:08:18 -05:00
2023-04-11 13:05:27 +09:00
请将以下内容添加到 `home.nix` 文件中以启用 `programs.starship` 模块
2021-03-15 13:18:42 -04:00
```nix
{
programs.starship = {
enable = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;
# character = {
# success_symbol = "[➜](bold green)";
# error_symbol = "[➜](bold red)";
# };
# package.disabled = true;
};
};
}
```
2022-01-15 17:08:31 -05:00
然后运行
2021-01-07 18:08:18 -05:00
```sh
home-manager switch
```
2023-04-11 13:05:27 +09:00
#### 声明式,全局,使用 NixOS
2021-01-07 18:08:18 -05:00
2023-04-11 13:05:27 +09:00
请将 `pkgs.starship` 添加至 `configuration.nix` 文件中的 `environment.systemPackages` 下,并运行
2021-01-07 18:08:18 -05:00
```sh
sudo nixos-rebuild switch
```