mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
docs(i18n): new Crowdin updates (#3460)
This commit is contained in:
@@ -119,7 +119,7 @@ description: Starship 是適合任何 shell 的最小、極速、高度客製化
|
||||
|
||||
#### Elvish
|
||||
|
||||
::: warning Only elvish v0.17 or higher is supported. :::
|
||||
::: warning 只有 elvish v0.17 或以上版本才有支援 :::
|
||||
|
||||
將以下內容放到 `~/.elvish/rc.elv` 的結尾:
|
||||
|
||||
@@ -147,9 +147,9 @@ description: Starship 是適合任何 shell 的最小、極速、高度客製化
|
||||
|
||||
```toml
|
||||
startup = [
|
||||
"mkdir ~/.cache/starship",
|
||||
"starship init nu | save ~/.cache/starship/init.nu",
|
||||
"source ~/.cache/starship/init.nu"
|
||||
"mkdir ~/.cache/starship",
|
||||
"starship init nu | save ~/.cache/starship/init.nu",
|
||||
"source ~/.cache/starship/init.nu",
|
||||
]
|
||||
prompt = "starship_prompt"
|
||||
```
|
||||
|
||||
@@ -32,11 +32,11 @@ end
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
|
||||
## Custom pre-prompt and pre-execution Commands in Bash
|
||||
## Bash 中的自定義預提示 (pre-prompt) 與預執行 (pre-execution) 指令
|
||||
|
||||
Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. 然而,Starship 有提供給你有限的能力來插入你自己的函式到渲染提示字元的程序中:
|
||||
Bash 不像其他大多的 shell 具有正式的預執行/預指令框架。 因為這個原因,很難在 `bash` 中提供能完全自定義的 hook。 然而,Starship 有提供給你有限的能力來插入你自己的函式到渲染提示字元的程序中:
|
||||
|
||||
- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do
|
||||
- 為了在畫出提示字元之前執行一個自定義的函式,請定義一個函式,並將它的名稱放入 `starship_precmd_user_func` 之中。 例如,為了要在提示字元前畫出一個火箭,你就要
|
||||
|
||||
```bash
|
||||
function blastoff(){
|
||||
@@ -45,14 +45,16 @@ function blastoff(){
|
||||
starship_precmd_user_func="blastoff"
|
||||
```
|
||||
|
||||
- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break.
|
||||
- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). 然而,你**必須**在初始化 Starship _之前_ 對 DEBUG 訊號設下trap! Starship 可以保留 DEBUG trap 的數值,但是如果該 trap 在 starship 啟動後被被覆寫,某些功能會損壞。
|
||||
|
||||
```bash
|
||||
function blastoff(){
|
||||
echo "🚀"
|
||||
}
|
||||
trap blastoff DEBUG # Trap DEBUG *before* running starship
|
||||
set -o functrace
|
||||
eval $(starship init bash)
|
||||
set +o functrace
|
||||
```
|
||||
|
||||
## Custom pre-prompt and pre-execution Commands in PowerShell
|
||||
@@ -67,33 +69,33 @@ function Invoke-Starship-PreCommand {
|
||||
}
|
||||
```
|
||||
|
||||
## Change Window Title
|
||||
## 改變視窗標題
|
||||
|
||||
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
|
||||
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish 甚至預設就會這樣做。 Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
|
||||
|
||||
First, define a window title change function (identical in bash and zsh):
|
||||
首先,定義一個改變視窗標題的函式(在 bash 與 zsh 之中都一樣):
|
||||
|
||||
```bash
|
||||
function set_win_title(){
|
||||
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007"
|
||||
echo -ne "\033]0; 你的標題在此 \007"
|
||||
}
|
||||
```
|
||||
|
||||
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
|
||||
你可以利用變數來自定義這個標題(`$USER`、`$HOSTNAME` 與 `$PWD` 是很受歡迎的選項)。
|
||||
|
||||
In `bash`, set this function to be the precmd starship function:
|
||||
在 `bash` 中,將這個函式設定為 Starship 的預執行函式:
|
||||
|
||||
```bash
|
||||
starship_precmd_user_func="set_win_title"
|
||||
```
|
||||
|
||||
In `zsh`, add this to the `precmd_functions` array:
|
||||
在 `zsh` 中,將這個函式加入 `precmd_functions` 陣列:
|
||||
|
||||
```bash
|
||||
precmd_functions+=(set_win_title)
|
||||
```
|
||||
|
||||
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent.
|
||||
如果你喜歡這個結果,把這幾行加入你的 shell 設定檔中(`~/.bashrc` or `~/.zsrhc`)來將此設為永久設定。
|
||||
|
||||
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`:
|
||||
|
||||
@@ -161,9 +163,9 @@ Note: `continuation_prompt` should be set to a literal string without any variab
|
||||
|
||||
Note: Continuation prompts are only available in the following shells:
|
||||
|
||||
- `bash`
|
||||
- `zsh`
|
||||
- `PowerShell`
|
||||
- `bash`
|
||||
- `zsh`
|
||||
- `PowerShell`
|
||||
|
||||
### 範例
|
||||
|
||||
@@ -176,26 +178,26 @@ continuation_prompt = "▶▶"
|
||||
|
||||
## 風格字串
|
||||
|
||||
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
|
||||
風格字串是一個以空白分開的單詞清單。 單字並不會區分大小寫(換句話說,`bold` 與 `BoLd` 是被當作兩個相同的字串)。 每個單詞可以是下列其中之一:
|
||||
|
||||
- `bold`
|
||||
- `italic`
|
||||
- `underline`
|
||||
- `dimmed`
|
||||
- `inverted`
|
||||
- `bg:<color>`
|
||||
- `fg:<color>`
|
||||
- `<color>`
|
||||
- `none`
|
||||
- `bold`
|
||||
- `斜體字`
|
||||
- `underline`
|
||||
- `dimmed`
|
||||
- `inverted`
|
||||
- `bg:<color>`
|
||||
- `fg:<color>`
|
||||
- `<color>`
|
||||
- `none`
|
||||
|
||||
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
|
||||
其中 `<color>` 是指定顏色用的(下面解釋)。 `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 單詞在字串中的順序不重要。
|
||||
|
||||
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.
|
||||
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. 未來可能會將 `none` 與其他符號一起使用的情形視為是一種錯誤。
|
||||
|
||||
A color specifier can be one of the following:
|
||||
一個顏色指定符號可以是下列其中之一:
|
||||
|
||||
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
|
||||
- A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
|
||||
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
|
||||
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
|
||||
- 一個 `#` 後面跟隨著六位數的十六進位數字。 這個指定了 [RGB 十六進制色碼](https://www.w3schools.com/colors/colors_hexadecimal.asp)。
|
||||
- 一個介於 0~255 之間的數字。 這個指定了 [8-bit ANSI 色碼](https://i.stack.imgur.com/KTSQa.png)。
|
||||
|
||||
If multiple colors are specified for foreground/background, the last one in the string will take priority.
|
||||
如果前景/後景被指定了多種顏色,最後一個顏色具有最高優先性。
|
||||
|
||||
+208
-149
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
|
||||
|
||||
## Why do I see `Executing command "..." timed out.` warnings?
|
||||
|
||||
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
|
||||
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
|
||||
|
||||
## 我發現一些看不懂或意料外的符號,那是代表什麼意思?
|
||||
|
||||
|
||||
+157
-89
@@ -169,159 +169,227 @@
|
||||
|
||||
- 安裝至少一個 [Nerd Font](https://www.nerdfonts.com/) 字體,並在終端中啟用(例如,你可以試試 [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads))。
|
||||
|
||||
### 入門
|
||||
### Step 1. Install Starship
|
||||
|
||||
**備註:**由於不同平台的數量眾多,下方僅顯示部分已支持平台。 找不到你正在使用的平台? 我想你可以來[額外平台說明](https://starship.rs/installing/)看看。
|
||||
Select your operating system from the list below to view installation instructions:
|
||||
|
||||
1. 安裝 **starship** 執行檔:
|
||||
<details>
|
||||
<summary>Android</summary>
|
||||
|
||||
Install Starship using any of the following package managers:
|
||||
|
||||
#### 安裝最新版本
|
||||
| Repository | Instructions |
|
||||
| --------------------------------------------------------------------------------- | ---------------------- |
|
||||
| [Termux](https://github.com/termux/termux-packages/tree/master/packages/starship) | `pkg install starship` |
|
||||
|
||||
</details>
|
||||
|
||||
##### 從預構建的二進制包,並且使用 Shell 命令:
|
||||
<details>
|
||||
<summary>BSD</summary>
|
||||
|
||||
```sh
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
||||
```
|
||||
Install Starship using any of the following package managers:
|
||||
|
||||
如果想更新已安裝的 Starship,請重新執行上述指令。 指令只會更新 Starship 執行檔本身,不會影響到任何已撰寫的設定檔。
|
||||
| Distribution | Repository | Instructions |
|
||||
| ------------ | -------------------------------------------------------- | --------------------------------- |
|
||||
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
|
||||
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
|
||||
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
|
||||
|
||||
**備註** —— 安裝腳本的預設值可以被覆蓋,請使用以下指令查看內置說明。
|
||||
</details>
|
||||
|
||||
```sh
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --help
|
||||
```
|
||||
<details>
|
||||
<summary>Linux</summary>
|
||||
|
||||
Install the latest version for your system:
|
||||
|
||||
#### 使用套件管理器安裝:
|
||||
```sh
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
||||
```
|
||||
|
||||
Alternatively, install Starship using any of the following package managers:
|
||||
|
||||
##### 使用 [Homebrew](https://brew.sh/):
|
||||
| Distribution | Repository | Instructions |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
||||
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
|
||||
| _Any_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
|
||||
| _Any_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
|
||||
| _Any_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
|
||||
| Alpine Linux 3.13+ | [Alpine Linux Packages](https://pkgs.alpinelinux.org/packages?name=starship) | `apk add starship` |
|
||||
| Arch Linux | [Arch Linux Community](https://archlinux.org/packages/community/x86_64/starship) | `pacman -S starship` |
|
||||
| CentOS 7+ | [Copr](https://copr.fedorainfracloud.org/coprs/atim/starship) | `dnf copr enable atim/starship` <br /> `dnf install starship` |
|
||||
| Fedora 31+ | [Fedora Packages](https://src.fedoraproject.org/rpms/rust-starship) | `dnf install starship` |
|
||||
| NixOS | [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/starship/default.nix) | `nix-env -iA nixos.starship` |
|
||||
| Gentoo | [Gentoo Packages](https://packages.gentoo.org/packages/app-shells/starship) | `emerge app-shells/starship` |
|
||||
| Manjaro | | `pacman -S starship` |
|
||||
| NixOS | [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/starship/default.nix) | `nix-env -iA nixpkgs.starship` |
|
||||
| Void Linux | [Void Linux Packages](https://github.com/void-linux/void-packages/tree/master/srcpkgs/starship) | `xbps-install -S starship` |
|
||||
|
||||
```sh
|
||||
brew install starship
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>macOS</summary>
|
||||
|
||||
##### 使用 [Scoop](https://scoop.sh):
|
||||
Install the latest version for your system:
|
||||
|
||||
```powershell
|
||||
scoop install starship
|
||||
```
|
||||
```sh
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
||||
```
|
||||
|
||||
2. 將初始化腳本 (script) 加入你的 shell 的設定檔:
|
||||
Alternatively, install Starship using any of the following package managers:
|
||||
|
||||
| Repository | Instructions |
|
||||
| -------------------------------------------------------- | --------------------------------------- |
|
||||
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
|
||||
| [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
|
||||
| [Homebrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
|
||||
| [MacPorts](https://ports.macports.org/port/starship) | `port install starship` |
|
||||
|
||||
#### Bash
|
||||
</details>
|
||||
|
||||
將以下內容放到 `~/.bashrc` 的結尾:
|
||||
<details>
|
||||
<summary>Windows</summary>
|
||||
|
||||
```sh
|
||||
# ~/.bashrc
|
||||
Install Starship using any of the following package managers:
|
||||
|
||||
eval "$(starship init bash)"
|
||||
```
|
||||
| Repository | Instructions |
|
||||
| -------------------------------------------------------------------------------- | --------------------------------------- |
|
||||
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
|
||||
| [Chocolatey](https://community.chocolatey.org/packages/starship) | `choco install starship` |
|
||||
| [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
|
||||
| [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/starship.json) | `scoop install starship` |
|
||||
|
||||
</details>
|
||||
|
||||
#### Fish
|
||||
### Step 2. Setup your shell to use Starship
|
||||
|
||||
將以下內容放到 `~/.config/fish/config.fish` 的結尾:
|
||||
Configure your shell to initialize starship. Select yours from the list below:
|
||||
|
||||
```sh
|
||||
# ~/.config/fish/config.fish
|
||||
<details>
|
||||
<summary>Bash</summary>
|
||||
|
||||
starship init fish | source
|
||||
```
|
||||
將以下內容放到 `~/.bashrc` 的結尾:
|
||||
|
||||
```sh
|
||||
eval "$(starship init bash)"
|
||||
```
|
||||
|
||||
#### Zsh
|
||||
</details>
|
||||
|
||||
將以下內容放到 `~/.zshrc` 的結尾:
|
||||
<details>
|
||||
<summary>Cmd</summary>
|
||||
|
||||
```sh
|
||||
# ~/.zshrc
|
||||
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Create a file at this path `%LocalAppData%\clink\starship.lua` with the following contents:
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
```
|
||||
```lua
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
#### PowerShell
|
||||
<details>
|
||||
<summary>Elvish</summary>
|
||||
|
||||
將以下內容放到 `Microsoft.PowerShell_profile.ps1` 的結尾。 你可以藉由在 PowerShell 查詢 `$PROFILE` 變數以取得這個檔案的位置。 一般來說,檔案會出現在 `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`,若是在 -Nix 上,檔案則會出現在 `~/.config/powershell/Microsoft.PowerShell_profile.ps1`。
|
||||
將以下內容放到 `~/.elvish/rc.elv` 的結尾:
|
||||
|
||||
```powershell
|
||||
Invoke-Expression (&starship init powershell)
|
||||
```
|
||||
```sh
|
||||
eval (starship init elvish)
|
||||
```
|
||||
|
||||
Note: Only Elvish v0.17+ is supported
|
||||
|
||||
#### Ion
|
||||
</details>
|
||||
|
||||
將以下內容放到 `~/.config/ion/initrc` 的結尾:
|
||||
<details>
|
||||
<summary>Fish</summary>
|
||||
|
||||
```sh
|
||||
# ~/.config/ion/initrc
|
||||
將以下內容放到 `~/.config/fish/config.fish` 的結尾:
|
||||
|
||||
eval $(starship init ion)
|
||||
```
|
||||
```fish
|
||||
starship init fish | source
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
#### Elvish
|
||||
<details>
|
||||
<summary>Ion</summary>
|
||||
|
||||
**Warning** Only elvish v0.17 or higher is supported. 將以下內容放到 `~/.elvish/rc.elv` 的結尾:
|
||||
將以下內容放到 `~/.config/ion/initrc` 的結尾:
|
||||
|
||||
```sh
|
||||
# ~/.elvish/rc.elv
|
||||
```sh
|
||||
eval $(starship init ion)
|
||||
```
|
||||
|
||||
eval (starship init elvish)
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Nushell</summary>
|
||||
|
||||
#### Tcsh
|
||||
Add the following to the end of your Nushell configuration (find it by running `config path`):
|
||||
|
||||
將以下內容放到 `~/.tcshrc` 的結尾:
|
||||
```toml
|
||||
startup = [
|
||||
"mkdir ~/.cache/starship",
|
||||
"starship init nu | save ~/.cache/starship/init.nu",
|
||||
"source ~/.cache/starship/init.nu",
|
||||
]
|
||||
prompt = "starship_prompt"
|
||||
```
|
||||
|
||||
```sh
|
||||
# ~/.tcshrc
|
||||
</details>
|
||||
|
||||
eval `starship init tcsh`
|
||||
```
|
||||
<details>
|
||||
<summary>PowerShell</summary>
|
||||
|
||||
Add the following to the end of your PowerShell configuration (find it by running `$PROFILE`):
|
||||
|
||||
#### Xonsh
|
||||
```powershell
|
||||
Invoke-Expression (&starship init powershell)
|
||||
```
|
||||
|
||||
將以下內容加到 `~/.xonshrc` 的結尾:
|
||||
</details>
|
||||
|
||||
```sh
|
||||
# ~/.xonshrc
|
||||
<details>
|
||||
<summary>Tcsh</summary>
|
||||
|
||||
execx($(starship init xonsh))
|
||||
```
|
||||
將以下內容放到 `~/.tcshrc` 的結尾:
|
||||
|
||||
```sh
|
||||
eval `starship init tcsh`
|
||||
```
|
||||
|
||||
#### Cmd
|
||||
</details>
|
||||
|
||||
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
|
||||
<details>
|
||||
<summary>Xonsh</summary>
|
||||
|
||||
```lua
|
||||
-- starship.lua
|
||||
將以下內容放到 `~/.xonshrc` 的結尾:
|
||||
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
```python
|
||||
execx($(starship init xonsh))
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
#### Nushell
|
||||
<details>
|
||||
<summary>Zsh</summary>
|
||||
|
||||
**Warning** This will change in the future. 只支援 nu v0.33 以上的版本。 Add the following to your nu config file. 你可以透過在 nu 執行 `config path` 指令來取得設定檔的位置。
|
||||
將以下內容放到 `~/.zshrc` 的結尾:
|
||||
|
||||
```toml
|
||||
startup = [
|
||||
"mkdir ~/.cache/starship",
|
||||
"starship init nu | save ~/.cache/starship/init.nu",
|
||||
"source ~/.cache/starship/init.nu"
|
||||
]
|
||||
prompt = "starship_prompt"
|
||||
```
|
||||
```sh
|
||||
eval "$(starship init zsh)"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Step 3. Configure Starship
|
||||
|
||||
Start a new shell instance, and you should see your beautiful new shell prompt. If you're happy with the defaults, enjoy!
|
||||
|
||||
If you're looking to further customize Starship:
|
||||
|
||||
- **[Configuration](https://starship.rs/config/)** – learn how to configure Starship to tweak your prompt to your liking
|
||||
|
||||
- **[Presets](https://starship.rs/presets/)** – get inspired by the pre-built configuration of others
|
||||
|
||||
## 🤝 貢獻
|
||||
|
||||
@@ -335,11 +403,11 @@
|
||||
|
||||
請看之前這些幫助我們創造 Starship 的前任作品。 🙏
|
||||
|
||||
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - 給太空人的 ZSH 提示。
|
||||
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** – A ZSH prompt for astronauts.
|
||||
|
||||
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - 使用 Javascript 撰寫的跨 shell robbyrussell 主題。
|
||||
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** – Cross-shell robbyrussell theme written in JavaScript.
|
||||
|
||||
- **[reujab/silver](https://github.com/reujab/silver)** - 一個跨 shell、可客製化、像 powerline 的圖案提示字元。
|
||||
- **[reujab/silver](https://github.com/reujab/silver)** – A cross-shell customizable powerline-like prompt with icons.
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
|
||||
@@ -109,7 +109,7 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
|
||||
error_symbol = "[✖](bold red)"
|
||||
```
|
||||
|
||||
*Note:* The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
|
||||
_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
|
||||
|
||||
#### 指令持續時間
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ symbol = " "
|
||||
[nix_shell]
|
||||
symbol = " "
|
||||
|
||||
[nodejs]
|
||||
symbol = " "
|
||||
|
||||
[package]
|
||||
symbol = " "
|
||||
|
||||
@@ -110,7 +113,7 @@ format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]'
|
||||
format = '\[[$symbol($version)]($style)\]'
|
||||
|
||||
[cmd_duration]
|
||||
format = '\[[⏱ $duration ]($style)\]'
|
||||
format = '\[[⏱ $duration]($style)\]'
|
||||
|
||||
[cobol]
|
||||
format = '\[[$symbol($version)]($style)\]'
|
||||
|
||||
Reference in New Issue
Block a user