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

94 lines
2.0 KiB
Markdown
Raw Normal View History

2021-05-01 14:20:08 -04:00
# 🚀 高级安装
2021-01-07 18:08:18 -05:00
2021-05-01 14:20:08 -04:00
安装Starship有以下两个步骤:
2021-01-07 18:08:18 -05:00
2021-05-01 14:20:08 -04:00
1. 下载 **starship** 的可执行文件
1. 修改 shell 的初始化脚本,让 starship 显示命令提示符
2021-01-07 18:08:18 -05:00
2021-05-01 14:20:08 -04:00
大部分用户按照[主页](/guide/#🚀-installation)上的步骤安装即可, 但有一些特殊系统上的安装步骤不同。
2021-01-07 18:08:18 -05:00
2022-01-15 17:08:31 -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-02-21 14:13:18 -05:00
### 前置要求
2021-03-15 13:18:42 -04:00
2021-02-21 14:13:18 -05:00
```sh
pkg install getconf
```
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
2021-04-22 17:12:09 -04:00
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --bin-dir /data/data/com.termux/files/usr/bin
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
```
2021-01-07 18:08:18 -05:00
## [Nix](https://nixos.wiki/wiki/Nix)
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
```
2021-04-05 10:55:57 -04:00
#### Declarative, single user, via [home-manager](https://github.com/nix-community/home-manager)
2021-01-07 18:08:18 -05:00
2022-01-15 17:08:31 -05: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
```
#### Declarative, system-wide, with NixOS
2022-01-15 17:08:31 -05:00
在您的 `configuration.nix`中,将 `pkgs.starship` 添加到 `environment.systemPackages`,然后运行
2021-01-07 18:08:18 -05:00
```sh
sudo nixos-rebuild switch
```