Starship官网:https://starship.rs/
一、安装
首先需要先安装scoop,参考:
📃 Scoop包管理
通过scoop安装:
$ scoop install starship
Installing 'starship' (0.48.0) [64bit]
starship-x86_64-pc-windows-msvc.zip (2.1 MB) [================================================================] 100%
Checking hash of starship-x86_64-pc-windows-msvc.zip ... ok.
Extracting starship-x86_64-pc-windows-msvc.zip ... done.
Linking ~\scoop\apps\starship\current => ~\scoop\apps\starship\0.48.0
Creating shim for 'starship'.
'starship' (0.48.0) was installed successfully!
Notes
-----
Usage: Add 'Invoke-Expression (&starship init powershell)' to the end of your PowerShell $PROFILE.
Prerequisites: A Powerline font installed and enabled in your terminal.
'starship' suggests installing 'extras/vcredist2019'.
PS C:\WINDOWS\system32> Invoke-Expression (&starship init powershell)
安装完后,使用命令激活此shell:
Invoke-Expression (&starship init powershell)
如果需要每次启动都激活,可以将此命令加入PowerShell Profile,路径如下:
语雀内容
启动后效果如下:
在VSCode中的表现:
二、配置
配置文件 %USERPROFILE%\.config\starship.toml
:
# Don't print a new line at the start of the prompt
add_newline = false
# Replace the "❯" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
# Enable the package module, showing it from the prompt completely
[package]
disabled = false
[nodejs]
format = "via [⬢ nodejs $version](bold green) "
[python]
format = "via [🐍 python $version](bold green) "
在VSCode中:
在WebStrom中:
参考:https://starship.rs/zh-cn/config/