个人使用的oh my zsh+iTerm2

318 阅读1分钟

检查zsh版本(mac一般默认自带)

~ zsh --version
zsh 5.8 (x86_64-apple-darwin21.0)

oh my zsh

官网安装

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

仓库目录cd ~/.oh-my-zsh

插件

插件安装的目录 cd ~/.oh-my-zsh/custom/plugins

  1. autojump (自动跳转目录)

    • 需要安装python@3.10 brew install python@3.10
    • 安装autojump brew install autojump
  2. zsh-autosuggestions (智能提示并补全)

  3. zsh-syntax-highlighting (命令行高亮)

配置

  • 配置文件目录 vim ~/.zshrc

  • 配置plugins

     plugins=(
         autojump 
         zta-autosuggestions
         zsh-syntax-highlighting
     )
    
  • 配置themes agnoster

    ZSH_THEME="agnoster"
    
        # clone
        git clone https://github.com/powerline/fonts.git --depth=1
        # install
        cd fonts
        ./install.sh
        # clean-up a bit
        cd ..
        rm -rf fonts
    
    • iTerm2中配置: Profiles-Text

      image.png

    • vscode配置 "terminal.integrated.fontFamily": "Meslo LG S for Powerline"

    • 隐藏主机和用户名

      1. vim ~/.oh-my-zsh/themes/agnoster.zsh-theme

      2. 找到prompt_context,将代码注释

        image.png

  • 每次配置文件修改后,需要重启生效 source ~/.zshrc

iTerm2

官网安装

个人习惯:

创建两个profile

  1. 正常显示
    • 设置快捷热键 double click
  2. 全屏显示
    • 设置快捷热键 组合键