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

95 lines
2.1 KiB
Markdown
Raw Normal View History

2021-08-14 09:24:51 -04:00
# 🚀 進階安裝
2021-01-07 18:08:18 -05:00
2021-08-14 09:24:51 -04:00
要安裝 starship,你必須做兩件事:
2021-01-07 18:08:18 -05:00
2021-08-14 09:24:51 -04:00
1. 下載 **starship** 執行檔到你的電腦裡
1. 修改 shell 的初始化腳本,讓其使用 starship 作為提示字元
2021-01-07 18:08:18 -05:00
2021-08-14 09:24:51 -04:00
對大部分的使用者來說,在[主頁面](/guide/#🚀-installation)的安裝指引皆足以正常運作。 然而,對於一些較特別的平台,我們需要不同的安裝指引。
2021-01-07 18:08:18 -05:00
2021-08-14 09:24:51 -04:00
有太多平台不適用於主要的 README.md 檔案了,所以這裡有一些來自社群的其他平台的安裝指引。 你的平台不在這裡嗎? 如果你找出怎麼安裝,請幫我們加上你的指引!
2021-03-15 13:18:42 -04:00
## [Chocolatey](https://chocolatey.org)
### 先決要求
2021-08-14 09:24:51 -04:00
前往[Chocolatey 安裝頁面](https://chocolatey.org/install),並且跟隨指引來安裝 Chocolatey。
2021-03-15 13:18:42 -04:00
2021-08-14 09:24:51 -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-08-14 09:24:51 -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)
### 安裝
On Funtoo Linux, starship can be installed from [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) via Portage:
```sh
emerge app-shells/starship
```
2021-01-07 18:08:18 -05:00
## [Nix](https://nixos.wiki/wiki/Nix)
2021-11-07 18:07:39 +00:00
### Getting the Binary
2021-01-07 18:08:18 -05:00
2021-08-14 09:24:51 -04:00
#### 命令式
2021-01-07 18:08:18 -05:00
```sh
nix-env -iA nixos.starship
```
2021-08-14 09:24:51 -04:00
#### 聲明式、單個使用者,使用 [home-manager](https://github.com/nix-community/home-manager)
2021-01-07 18:08:18 -05:00
2021-11-07 18:07:39 +00:00
Enable the `programs.starship` module in your `home.nix` file, and add your settings
2021-03-15 13:18:42 -04:00
```nix
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;
# character = {
# success_symbol = "[➜](bold green)";
# error_symbol = "[➜](bold red)";
# };
# package.disabled = true;
};
};
}
```
2021-11-07 18:07:39 +00:00
then run
2021-01-07 18:08:18 -05:00
```sh
home-manager switch
```
2021-08-14 09:24:51 -04:00
#### 聲明式、全系統,使用 NixOS
2021-01-07 18:08:18 -05:00
2021-11-07 18:07:39 +00:00
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run
2021-01-07 18:08:18 -05:00
```sh
sudo nixos-rebuild switch
```