Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改附录A:zsh未遵循原文段落格式的问题 #500

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions book/A-git-in-other-environments/sections/zsh.asc
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@ zstyle ':vcs_info:git:*' formats '%b'
----

当你的命令行位于一个 Git 仓库目录时,在任何时候,都可以在命令行窗口右侧显示当前分支。
(当然也可以在左侧显示,只需把上面 PROMPT 的注释去掉即可。)
(当然也可以在左侧显示,只需把上面 `PROMPT` 的注释去掉即可。)
它看起来像这样:

.自定义 `zsh` 提示符.
image::images/zsh-prompt.png[自定义 `zsh` 提示符.]

关于 vcs_info 的更多信息,可参见 `zshcontrib(1)` 手册页面中对应的文档,或访问
http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[] 在线浏览。
关于 `vcs_info` 的更多信息,可参见 `zshcontrib(1)` 手册页面中对应的文档,或访问 http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[] 在线浏览。

比起 vcs_info 而言,你可能更偏好提供了 Git 的命令提示符定制脚本 `git-prompt.sh` 。
更多信息见 https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] 。
比起 `vcs_info` 而言,你可能更偏好提供了 Git 的命令提示符定制脚本 `git-prompt.sh`;更多信息见 https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[]。
`git-prompt.sh` 同时兼容 Bash 和 Zsh。

Zsh 本身已足够强大,但还有一些专门为它打造的完整框架,使它更加完善。
Expand All @@ -54,4 +52,4 @@ oh-my-zsh 的扩展系统包含强大的 Git Tab 补全功能,且许多提示

[[oh_my_zsh_git]]
.一个 oh-my-zsh 主题的示例.
image::images/zsh-oh-my.png[一个 oh-my-zsh 主题的示例.]
image::images/zsh-oh-my.png[一个 oh-my-zsh 主题的示例]
Loading