「MacBook APP」On My Zsh 个性化终端
安装
Mac自带的终端系统其实挺好用的,iterm2 https://iterm2.com/ 有很多自定义的配置,及丰富的插件给用户!深受大家的喜爱!
linux 下的命令解释器有很多,默认是 bash,除此之外还有 csh dash ksh sh zsh … 通过命令可以查看系统当前有的命令解释器
1 | cat /etc/shells |
查看当前系统启用的命令解释器
1 | ~ echo $SHELL |
切换不同的shell
1 | 切换到bash |
其中 zsh 最为好用,同时有个开源的项目对其增强了,那就是 on my zsh
,项目地址:https://github.com/ohmyzsh/ohmyzsh
拥有众多的主题和插件等,灰常强大👍🏻,看项目的 Star就知道这个项目有多牛逼 o( ̄▽ ̄)d!
安装
1 | $ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
如果慢的话,通过其他方式下载下来,执行其中的 install 即可。
将项目中的.zshrc
复制到我们用户目录下一份,复制完毕后如下所示(安装后存在的话就不用了)
1 | ➜ ~ ll -a |
更改默认的命令解释器
1 | chsh -s /bin/zsh |
修改主题
官方给的主题地址:https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
修改配置文件,对应的主题名称即可
1 | # Set name of the theme to load --- if set to "random", it will |
安装其他主题
例如:https://github.com/romkatv/powerlevel10k 官方给的安装文档很清楚
第一步 安装字体:MesloLGS NF Regular.ttf 其他字体下载地址:https://www.nerdfonts.com/font-downloads
第二步 安装主题:powerlevel10k Oh My Zsh 方式安装 https://github.com/romkatv/powerlevel10k#oh-my-zsh
第三步 配置主题:p10k configure
最终结果样式:
个性化插件
官方插件列表:https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
推荐其他插件,安装给的文档安装即可。
zsh-autosuggestions
GitHub https://github.com/zsh-users/zsh-autosuggestions
zsh-syntax-highlighting
GitHub [https://github.com/zsh-users/zsh-syntax-highlighting](