Skip to content

Commit

Permalink
修改附录A:zsh未遵循原文段落格式的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherry520 authored and networm committed Aug 13, 2024
1 parent 0393b52 commit 1b8b81f
Showing 1 changed file with 4 additions and 6 deletions.
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 主题的示例]

0 comments on commit 1b8b81f

Please sign in to comment.