关于linux:推荐一套终端美化方案Pure

0次阅读

共计 1456 个字符,预计需要花费 4 分钟才能阅读完成。

效果图

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

所需组件

  1. 终端:iTerm2 或 Hyper
  2. SHELL:zsh
  3. zsh 扩大插件:oh-my-zsh
  4. 提示符插件:Pure
  5. 终端主题:snazzy
  6. 高亮插件:zsh-syntax-highlighting

具体步骤

装置终端(2 选 1)

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

切换为 zsh

ZSH 是一款功能强大的 SHELL。

  1. 查看以后 SHELL
echo $SHELL
  1. 若以后 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…

步骤

  1. 装置Pure
npm install --global pure-prompt
  1. ~/.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 插件来装置,即:

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

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

正文完
 0