Oh My Zsh 是什么
Oh My Zsh 是一款社区驱动的命令行工具,正如它的主页上说的,Oh My Zsh 是一种生活方式。它基于 zsh 命令行,提供了主题配置,插件机制,已经内置的便捷操作。给我们一种全新的方式使用命令行。
**Oh My Zsh 是基于 zsh 命令行的一个扩展工具集,提供了丰富的扩展功能
安装 Oh My Zsh 前提条件:必须已安装 zsh
**
查看是否安装 zsh
# 打开终端,在终端上输入:
zsh --version
# 这个命令来查看我们的电脑上是否安装了 Zsh
# 查看系统当前 shell
cat /etc/shells
安装 Oh My Zsh 方法
可以通过 curl 或 wget 两种方式来安装,用一条命令即可安装。
curl 安装 - 选一个就行
#GitHub:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#Gitee ( 国内镜像 )
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
安装成功
xxxx% sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Cloning into '/Users/xxxx/.oh-my-zsh'...
remote: Counting objects: 831, done.
remote: Compressing objects: 100% (700/700), done.
remote: Total 831 (delta 14), reused 775 (delta 10), pack-reused 0
Receiving objects: 100% (831/831), 567.67 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (14/14), done.
Looking for an existing zsh config...
Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to ~/.zshrc
__ __
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
设置主题
open ~/.zshrc
# 找到 ZSH_THEME
# robbyrussell 是默认的主题
ZSH_THEME="robbyrussell"
# ZSH_THEME="样式名称"
保存之后重新打开生效
设置好看的主题
powerlevel10k很香,启动终端后会有引导帮助你配置,不仅好看,而且启动速度还快不多说,
#首先:
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
#然后
open ~/.zshrc
# .zshrc中设置:
ZSH_THEME="powerlevel10k/powerlevel10k"
重新打开就自动出现配置页面,按照提示一步步设置之后就成功啦
欢迎加入powerlevel10k
卸载 Oh My Zsh
终端输入 :
uninstall_oh_my_zsh
Are you sure you want to remove Oh My Zsh? [y/N] Y
终端提示信息:
Removing ~/.oh-my-zsh
Looking for original zsh config...
Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc
Found ~/.zshrc -- Renaming to ~/.zshrc.omz-uninstalled-20170820200007
Your original zsh config was restored. Please restart your session.
Thanks for trying out Oh My Zsh. It's been uninstalled.
如果不喜欢系统自带终端,推荐一个强大的终端 App,
iTerm2,非常好用的一个终端软件。