+-
推荐一套终端美化方案(Pure)
首页 专栏 linux 文章详情
0

推荐一套终端美化方案(Pure)

语冰 发布于 2 月 10 日

效果图

In the screenshot you see Pure running in Hyper with the hyper-snazzy theme and Menlo font.

所需组件

终端:iTerm2或Hyper SHELL:zsh zsh扩展插件:oh-my-zsh 提示符插件:Pure 终端主题:snazzy 高亮插件:zsh-syntax-highlighting

详细步骤

安装终端(2选1)

iTerm2:优秀的Mac终端,https://iterm2.com Hyper:一款基于Electron的全平台终端,https://hyper.is

切换为zsh

ZSH是一款功能强大的SHELL。

查看当前SHELL
echo $SHELL
若当前SHELL不是zsh,切换为zsh
chsh -s /bin/zsh

安装oh-my-zsh

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...

简单来说,oh-my-zsh是zsh的配置、主题、插件管理器。

安装命令:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

若无法访问github,则可通过配置hosts终端代理来解决,网上已有许多教程,故不再赘述。

安装Pure

Pretty, minimal and fast ZSH prompt

Pure是用来自定义zsh提示符和色彩的插件。

仓库地址:https://github.com/sindresorh...

步骤

安装 Pure
npm install --global pure-prompt
~/.zshrc文件的底部添加:
autoload -U promptinit; promptinit
prompt pure

安装主题

演示图使用的是snazzy这个主题,此主题支持几乎所有的终端

仓库地址:

iTerm2:https://github.com/sindresorh...

右键将README文件中的链接另存为至本地,双击打开,iTerm2会自动识别。

Hyper:https://github.com/sindresorh...
hyper install hyper-snazzy

安装高亮插件

zsh-syntax-highlighting是一款可通过语法分析来提供语法高亮的插件

仓库地址:https://github.com/zsh-users/...

步骤

它有许多的安装方式,我推荐作为oh-my-zsh插件来安装,即:

克隆仓库
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
~/.zshrc文件中找到plugins,添加名称(空格分隔)
plugins=( [plugins...] zsh-syntax-highlighting)
重载配置
source ~/.zshrc

感谢您阅读本文,关注我的公众号“语冰Yubing”可接收最新推送,里面也有我分享的一些优质资源。

linux macos
阅读 63 发布于 2 月 10 日
收藏
分享
本作品系原创, 采用《署名-非商业性使用-禁止演绎 4.0 国际》许可协议
avatar
语冰

一个坚持高质量内容创作的程序员

0 声望
0 粉丝
关注作者
0 条评论
得票 时间
提交评论
avatar
语冰

一个坚持高质量内容创作的程序员

0 声望
0 粉丝
关注作者
宣传栏
目录

效果图

In the screenshot you see Pure running in Hyper with the hyper-snazzy theme and Menlo font.

所需组件

终端:iTerm2或Hyper SHELL:zsh zsh扩展插件:oh-my-zsh 提示符插件:Pure 终端主题:snazzy 高亮插件:zsh-syntax-highlighting

详细步骤

安装终端(2选1)

iTerm2:优秀的Mac终端,https://iterm2.com Hyper:一款基于Electron的全平台终端,https://hyper.is

切换为zsh

ZSH是一款功能强大的SHELL。

查看当前SHELL
echo $SHELL
若当前SHELL不是zsh,切换为zsh
chsh -s /bin/zsh

安装oh-my-zsh

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...

简单来说,oh-my-zsh是zsh的配置、主题、插件管理器。

安装命令:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

若无法访问github,则可通过配置hosts终端代理来解决,网上已有许多教程,故不再赘述。

安装Pure

Pretty, minimal and fast ZSH prompt

Pure是用来自定义zsh提示符和色彩的插件。

仓库地址:https://github.com/sindresorh...

步骤

安装 Pure
npm install --global pure-prompt
~/.zshrc文件的底部添加:
autoload -U promptinit; promptinit
prompt pure

安装主题

演示图使用的是snazzy这个主题,此主题支持几乎所有的终端

仓库地址:

iTerm2:https://github.com/sindresorh...

右键将README文件中的链接另存为至本地,双击打开,iTerm2会自动识别。

Hyper:https://github.com/sindresorh...
hyper install hyper-snazzy

安装高亮插件

zsh-syntax-highlighting是一款可通过语法分析来提供语法高亮的插件

仓库地址:https://github.com/zsh-users/...

步骤

它有许多的安装方式,我推荐作为oh-my-zsh插件来安装,即:

克隆仓库
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
~/.zshrc文件中找到plugins,添加名称(空格分隔)
plugins=( [plugins...] zsh-syntax-highlighting)
重载配置
source ~/.zshrc

感谢您阅读本文,关注我的公众号“语冰Yubing”可接收最新推送,里面也有我分享的一些优质资源。