Mac终端配置指南

390 阅读1分钟

安装

  • iTerm2:www.iterm2.com/

    • 默认使用zsh终端
    chsh -s /bin/zsh
    
  • Oh my zsh

    # curl 安装方式
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    
  • PowerLine

    // 安装powerline
    pip install powerline-status --user
    
    // 如果提示没有安装pip 先安装pip
    sudo easy_install pip
    
  • PowerFonts

    // 使用HTTPS下载有可能会失败
    git clone git@github.com:powerline/fonts.git
    
    // 进入仓库文件夹,执行脚本
    ./install.sh
    
  • color-schemes

    // download
    https://iterm2colorschemes.com/
    

搭配

主题

使用

  • 导入外部主题

    //显示隐藏文件
    defaults write com.apple.finder AppleShowAllFiles -bool true
    //不显示隐藏文件
    defaults write com.apple.finder AppleShowAllFiles -bool false
    
    // 快捷键
    Command + Shift + .
    
    • 根目录-->.oh-my-zsh(macOS系统会自动隐藏'.'开头的文件)-->themes-->将想要的'-theme'文件粘贴到这个文件夹
  • 选择主题

    • 根目录-->.zshrc
    # Set name of the theme to load --- if set to "random", it will
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME="xxxx"
    # "xxxx"替换成想要的主题
    

挑选

配色

使用

  • iTerm2-->Perferences-->Profiles-->Colors-->Color Presets
    • 选择需要的颜色主题
    • 点击Import引入外部颜色主题

挑选

成果

image-20201105204420976

  • 字体:ubuntu mono derivative powerline bold 26
  • 配色:IC_Green_PPL
  • 主题:Spaceship ZSH(外部主题)
  • 插件:plugins=(git autojump extract rand-quote zsh-syntax-highlighting)

参考文章