starship/docs/zh-CN/guide/README.md

27 KiB
Raw Blame History


Starship – Cross-shell prompt

GitHub Actions workflow status Crates.io version Packaging status
All Contributors Chat on Discord


Website · Installation · Configuration

English  日本語  繁體中文  简体中文  Deutsch  Français  Русский

Starship is the minimal, blazing fast, and extremely customizable prompt for any shell!
The prompt shows information you need while you're working, while staying sleek and out of the way.


Starship with iTerm2 and the Snazzy theme

🍬 特性

  • 当上一个命令以非 0 状态退出时,提示字符会变为红色
  • 非当前登录用户的用户名
  • 当前 Java 版本()
  • 当前 Node.js 版本()
  • 当前 Rust 版本 (🦀)
  • 当前 Ruby 版本 (💎)
  • 当前 Python 版本 (🐍)
  • 当前 Go 版本 (🐹)
  • Nix-shell 环境检测
  • 显示环境变量
  • 当前目录下现在的包版本 (📦)
    • npm (Node.js)
    • cargo (Rust)
    • poetry (Python)
  • 当前电池剩余容量与状态
  • 当前 Git 分支与一应俱全的仓库状态
    • = — conflicting changes
    • — ahead of remote branch
    • — behind of remote branch
    • — diverged changes
    • ? — untracked changes
    • $ — stashed changes
    • ! — modified files
    • + — added files
    • » — renamed files
    • — deleted files
  • 如果超过设定阈值,上一个命令的执行时间
  • 后台运行进程数的指示器 ()
  • 当前 Kubernetes Cluster 与 Namespace ()
  • Current AWS profile (☁️)

🚀 安装

基础要求

入门

  1. 安装 starship 二进制文件:

    如果您不使用下面的平台,你可以**下载预编译的可执行文件**

    Homebrew

    $ brew install starship
    

    Rust (v1.38 or higher)

    $ cargo install starship
    

    Arch Linux (AUR)

    你可以使用 starship 这个名称在 AUR 上找到 Starship。 使用 yay或您最喜欢的 AUR helper 安装它。

    $ yay -S starship
    

    Nix (unstable)

    $ nix-env --install starship
    

    Termux

    $ pkg install starship
    

    Other x86-64 Linux Platforms

    Download a prebuilt binary and place in /usr/local/bin/

    $ wget -q --show-progress https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz
    $ tar xvf starship-x86_64-unknown-linux-gnu.tar.gz
    $ sudo mv starship /usr/local/bin/
    
  2. 将初始化脚本添加到您的 shell 的配置文件:

    Bash

    ~/.bashhrc 的最后,添加以下内容:

    # ~/.bashrc
    
    eval "$(starship init bash)"
    

    Fish

    ~/.config/fish/config.fish 的最后,添加以下内容:

    # ~/.config/fish/config.fish
    
    eval (starship init fish)
    

    Zsh

    ~/.zshrc 的最后,添加以下内容:

    # ~/.zshrc
    
    eval "$(starship init zsh)"
    

    Powershell

    Add the following to the end of ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 (or ~/.config/powershell/Microsoft.PowerShell_profile.ps1 on -Nix):

    # ~\Documents\PowerShell\Profile.ps1
    Invoke-Expression (&starship init powershell)
    

🔧 配置

For details on how to configure Starship, check out our documentation.

🤝 贡献

We are always looking for contributors of all skill levels! If you're looking to ease your way into the project, try out a good first issue.

急需

  • 👩‍💼 项目经理
    • 我们有一个GitHub项目有许多未经整理或没有被置于优先地位的新功能还有许多想法没有被列入 issues。 我们需要人来为项目发展方向指路!
  • 👩‍🎨 设计师
    • 想制作吸引人的网站吗? 太棒了! 我们正想要制作一个漂亮的主页,以彰显 Starship 的与众不同。 帮助设计 Starship 的品牌是尝试你新点子的一个巨大机会!
  • 👩‍💻 Rust 开发者
    • 我们需要符合语言习惯的高效的代码需要性能优化与跨平台编译优化……你可以在这里收获_大量_的成果 我 (@matchai) 是一枚 Rust 新手. 快来为我们指点迷津!

If you are interested in helping contribute to starship, please take a look at our Contributing Guide. Also, feel free to drop into our Discord server and say hi. 👋

贡献者

Thanks goes to these wonderful people (emoji key):

Matan Kushner
Matan Kushner

💻 🎨 🤔 🚇 🚧 👀 ⚠️
John Letey
John Letey

💻 🤔 👀 ⚠️
Tim Mulqueen
Tim Mulqueen

💻 🤔 👀 ⚠️
Tiffany Le-Nguyen
Tiffany Le-Nguyen

🤔 🚧 👀 📖
​Snuggle
Snuggle

🎨 🤔 🚧 👀
Ryan Leckey
Ryan Leckey

👀
Youssef Habri
Youssef Habri

💻
Kevin Song
Kevin Song

🐛 💻 📖 ⚠️
Andrew Dassonville
Andrew Dassonville

🐛 💻
MaT1g3R
MaT1g3R

💻 📖 ⚠️
André Zanellato
André Zanellato

💻 📖 ⚠️
Saghm Rossi
Saghm Rossi

💻 📖 ⚠️
Shu Kutsuzawa
Shu Kutsuzawa

💻 📖 ⚠️ 🌍
Saurav Sharma
Saurav Sharma

💻 📖
Thomas O'Donnell
Thomas O'Donnell

💻 ⚠️ 📖 👀
Bruno Bigras
Bruno Bigras

💻 👀
Neil Kistner
Neil Kistner

💻 ⚠️ 👀
Quinn Strahl
Quinn Strahl

💻 ⚠️
Titouan Vervack
Titouan Vervack

💻 ⚠️
Francisco Lopes
Francisco Lopes

💻
Andrew Houts
Andrew Houts

💻 📖 ⚠️
Nick Young
Nick Young

💻 📖 ⚠️ 👀
Gabriel de Perthuis
Gabriel de Perthuis

💻
Hofer-Julian
Hofer-Julian

📖
Yuji Ueki
Yuji Ueki

🖋 🌍
谢祯晖
谢祯晖

💻 📖 🌍 👀
Kutsuzawa Ryo
Kutsuzawa Ryo

👀 💻 ⚠️ 🌍
hdevalke
hdevalke

🤔
Kuba Clark
Kuba Clark

💻 📖 ⚠️
Gimbar
Gimbar

💻 ⚠️ 📖
Tom Hotston
Tom Hotston

💻 📖
Bijan Chokoufe Nejad
Bijan Chokoufe Nejad

💻 ⚠️ 👀
yuri
yuri

💻 📖 ⚠️
TsubasaKawajiri
TsubasaKawajiri

🌍
Ryo Yamashita
Ryo Yamashita

💻
Thomas Lee
Thomas Lee

💻
(´⌣`ʃƪ)
(´⌣`ʃƪ)

💻
Barnaby Keene
Barnaby Keene

💻
Keith Wade
Keith Wade

💻 ⚠️
LukeAI
LukeAI

📖
Zach Mertes
Zach Mertes

💻 📖 ⚠️
David Knaack
David Knaack

💻 📖 ⚠️
Carl Summers
Carl Summers

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

💭该项目受以下项目启发

Please check out these previous works that helped inspire the creation of starship. 🙏


Starship rocket icon

📝 License

Copyright © 2019-present, Starship Contributors.
This project is ISC licensed.