当前位置: 代码迷 >> 综合 >> mac终端美化之安装iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k]
  详细解决方案

mac终端美化之安装iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k]

热度:26   发布时间:2023-12-13 15:14:02.0

截图效果:
效果

安装ITerm2

brew cask install iterm2
  • 如果没有安装brew请在命令行执行安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • 如果不想安装brew可以使用去ITerm官网下载并安装.

下载主题

  • Solarized Dark theme
  • Solarized Light theme
  • 其他主题

保存到 本地后 打开iTerm-> profiles -> colors -> load presets.

安装 oh my zsh

安装命令

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

下载完成后编辑.zshrc文件并指定主题为agnoster

vim ~/.zshrc
set ZSH_THEME="agnoster"

安装Powerlevel9k主题

安装命令

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

下载完成后编辑.zashrc文件并指定主题

vim ~/.zshrc
set ZSH_THEME="powerlevel9k/powerlevel9k".

自定义设置可以参考这里.

安装字体

  • Meslo
  • Source Code Pro @14px字体比较协调.
  • Others @ powerline fonts
    下载后安装字体在iTerm2设置
    iTerm -> Preferences -> Profiles -> Text -> Change Font.
    重启即可生效

其他额外工作

  • auto suggestions
  • word jumping with arrow keys
  • shorter prompt style
  • syntax highlighting

Auto suggestions (for Oh My Zsh)

示例

  1. 下载到本地

    git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
  2. .zshrc插件设置中添加插件

    plugins=(zsh-autosuggestions)
  3. 重启iTerm2

  相关解决方案