StarShip 定制 Windows Terninal

StarShip 定制 Windows Terninal

StarShip 终端订制指南

1. 安装 Nerd Font 系列的字体

如果是 Windows 一定要通过 “管理员身份” 打开 powershell,然后执行:

choco install firacode

其他 OS 安装方式:https://github.com/tonsky/FiraCode/wiki/Installing

安装完字体后,在 WSL 的设置中将字体设置为新安装的 Fira Code

2. 安装 StarShip

# Windows 
scoop install starship

# Linux
curl -fsSL https://starship.rs/install.sh | sh

3. 启动 starship

Windows Powershell 下通过 echo $PROFILE 找到 powershell 启动配置文件(不存在则自行创建一个),然后打开文件,末尾添加:Invoke-Expression (&starship init powershell)

Linux 下:vi /etc/bash.bashrc,末尾添加 eval "$(starship init bash)"

4. 配置 ~/.config/starship.toml

command_timeout = 500
format = "$directory$git_branch$time$cmd_duration$character"
[line_break]
disabled = true

[character]
success_symbol = "[➜](bold green) "
error_symbol = "[✗](bold red) "

[cmd_duration]
min_time = 500
format = "took [$duration](bold yellow) "

[directory]
read_only = "🔒"
use_os_path_sep = true
truncate_to_repo = false
format = "[$path]($style)[$read_only]($read_only_style) "

[git_branch]
always_show_remote = true
symbol = "  "
style = "bold #e8ec00 inverted"
format = "on [$branch$symbol$remote_name/$remote_branch]($style) "

[time]
disabled = false
format = '[ 🕙 $time ]($style) '
time_format = "%I:%M:%S %p"
utc_time_offset = "+8"
style = "bold bg:#8a15e2"

[git_commit]
disabled = true

[git_state]
disabled = true

[git_status]
disabled = true

[package]
disabled = true

转载请声明出处: MinsonLee的博客:https://minsonlee.github.io

扫描下方二维码,关注公众号,接收更多实时内容

新猿呓码

打赏一个呗

取消

感谢客官打赏,您的打赏使我动力十足!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦