当我使用 ZSH 的主题 Powerlevel10k 时遇到问题?

I have a problem with it when i use Powerlevel10k which is a theme for ZSH?

我在使用 ZSH 的主题 Powerlevel10k 时遇到问题?

来自Powerlevel10k FAQ

Q: What do different symbols in Git status mean?

When using Lean, Classic or Rainbow style, Git status may look like this:

feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42

Legend:

| Symbol  | Meaning                                                           | Source                                               |
| --------| ------------------------------------------------------------------| ---------------------------------------------------- |
| feature | current branch; replaced with #tag or @commit if not on a branch  | git status                                           |
| master  | remote tracking branch; only shown if different from local branch | git rev-parse --abbrev-ref --symbolic-full-name @{u} |
| ⇣42     | this many commits behind the remote                               | git status                                           |
| ⇡42     | this many commits ahead of the remote                             | git status                                           |
| *42     | this many stashes                                                 | git stash list                                       |
| merge   | repository state                                                  | git status                                           |
| ~42     | this many merge conflicts                                         | git status                                           |
| +42     | this many staged changes                                          | git status                                           |
| !42     | this many unstaged changes                                        | git status                                           |
| ?42     | this many untracked files                                         | git status                                           |

See also: How do I change the format of Git status?

如果您在主目录的根目录下创建了一个 Git 存储库来存储点文件,您可能希望忽略其中未跟踪的文件。您可以通过执行以下命令来实现:

git -C ~ config status.showuntrackedfiles no

这将产生几个影响:

  • git status会更快。
  • git status 不会列出 171 个未跟踪的文件。
  • ?171 将从您的提示中消失。

您可以使用以下命令撤消上述命令:

git -C ~ config --unset status.showuntrackedfiles

如果您不想在主目录中的提示中看到 Git 状态,请将此参数添加到 ~/.p10k.zsh:

# Don't display Git status in prompt for Git repositories whose workdir matches
# this pattern.
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'

如果您根本不想在提示中看到 Git 状态,请从 ~/.p10k.zsh 中的 POWERLEVEL9K_LEFT_PROMPT_ELEMENTS 数组中删除 vcs