Loading... > 目前常用的 Linux 系统和 OS X 系统的默认 Shell 都是 bash,但是真正强大的 Shell 是深藏不露的 zsh, 这货绝对是马车中的跑车,跑车中的飞行车,史称『终极 Shell』,但是由于配置过于复杂,所以初期无人问津,很多人跑过来看看 zsh 的配置指南,什么都不说转身就走了。直到有一天,国外有个穷极无聊的程序员开发出了一个能够让你快速上手的zsh项目,叫做「oh my zsh」,Github 网址是: https://github.com/robbyrussell/oh-my-zsh ##检查mac是否自带 zsh //终端输入 cat /etc/shells ##把默认的终端 切换至 zsh chsh -s /bin/zsh ##如果自带终端没有zsh 可以选择下面的几种安装方式 > 你可以通过curl curl -Lhttps://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh ##手动安装 > 准备工作: 你的mac上需要安装git。 > 克隆代码库 git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh ##一步到位(建议) sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" > 安装完毕后,就会看见一个非常大字oh my zsh ,并且停留在“~” 状态下就表示已经安装完成。 ## Oh My Zsh 下载主题与设定 > 接下来,输入底下指令编辑Zsh设定档案来载入其他主题,如果想看每款主题风格,可以到Oh My Zsh的[官网Wiki Themes页面][1]看效果。官网需要一点点魔法才看到。。。 > 也可以去 这个[主题站][2] 同样 由于是github上的,访问懂得都懂。。。 ### 以我使用的主题为例子 <img src="https://s4.ax1x.com/2021/12/07/ocGroF.png" alt="ocGroF.png" border="0" style=""> >1.首先去克隆主题代码 git clone https://github.com/caiogondim/bullet-train.zsh.git >2.打开终端输入 open ~/oh-my-zsh/themes/ >3.将克隆下来的文件bullet-train.zsh-theme放在~/oh-my-zsh/themes/目录下 >4.打开终端输入 open ~/.zshrc // 把 ZSH_THEME="xxxxxx" 修改为 ZSH_THEME="bullet-train" //重新载入配置文件 source ~/.zshrc > 5.最重要的 字体!!!字体!!!字体!!!不安装字体 会显示乱码 //终端输入 //下载字体 git clone https://gitee.com/zhoutotong/powerline-fonts.git //install sudo ./install.sh //清除安装包 rm -rf powerline-fonts > 6.完事! ### 配置高亮和代码提示 >安装自动补全插件 >在终端输入命令: cd ~/.oh-my-zsh/custom/plugins git clone https://github.com/zsh-users/zsh-autosuggestions.git >安装命令高亮插件 >在终端输入命令: cd ~/.oh-my-zsh/custom/plugins git clone https://github.com/zsh-users/zsh-syntax-highlighting.git >配置 .zshrc 文件 >在终端输入命令: open ~/.zshrc >在 ~/.zshrc 中添加以下内容(随便找个地方就行): source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh >在 ~/.zshrc 中修改 plugins=(git) 为: plugins=(git zsh-autosuggestions zsh-syntax-highlighting) >保存修改 >让配置生效 >在终端执行命令 source ~/.zshrc ### ------------------- over ------------------- [1]: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes [2]: https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes END 最后修改:2021 年 12 月 07 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏 下一篇 上一篇 3 条评论 Loading... 挺胸的男士 March 25th, 2024 at 04:55 pm 哈哈哈哈 回复 Aluo December 8th, 2021 at 03:32 pm 回复 Moody December 8th, 2021 at 03:16 pm 写得好好哟,我要给你生猴子! 回复 发表评论 取消回复 使用cookie技术保留您的个人信息以便您下次快速评论,继续评论表示您已同意该条款 评论 * 私密评论 名称 * 🎲 邮箱 * 地址 发表评论 提交中...
3 条评论
哈哈哈哈
写得好好哟,我要给你生猴子!