Why Zsh
- 好看!
- 有git实时显示
简单直白粗暴、上述亮点就是我换oh my zsh的初衷。用了它直接免去了很多的重复操作、让终端更美观、让生活更美好。
安装
Talk is Cheap Show me the Code
1 | |
之后,切换默认打开的终端指令。如果想换回 bash 可以用 chsh -s /bin/bash 换回来。
至于如何切换主题,见下一章。
更换个人的主题
- 将自己的主题文件(
file.theme)放入~/.oh-my-zsh/themes文件夹中 - 在
~/.zshrc中ZSH_THEME选择自己的主题。
更换Powerline主题 (Optional)
-
git下powerline的主题。
1
git clone git://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme随后,
./install.sh就好了。 -
安装字体。
1
git clone https://github.com/powerline/fonts.git同理,
./install.sh就可以安装号字体了。 - 终端下设置字体为
Meslo LG M for powerLine。 -
在zshrc里设置主题
1
ZSH_THEME="powerline"
[Plugin] Zsh-syntax-highlighting
可以语法高亮你的 shell 命令,重要的是会标出你输入错误的指令。

- 从 git 上下载到指定位置
1
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting - 添加到
zshrc中的plugin list它的名字为zsh-syntax-highlighting,添加到plugins中就好了
[Plugin] Zsh-autosuggestions
它会根据你的指令输入记录来补全你的指令,非常有用。

- 从 git 上下载
1
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions - 添加到
zshrc中的plugin list它的名字为zsh-autosuggestions,添加到plugins中就好了
参考
本文主要参考为bo_song的文章,里面还有详细的配色可以去关注一下~