Mac配置oh my zsh,並使用ITerm2

Mac配置oh my zsh,並使用ITerm2

先看看最終效果

image-20191115151234824

  1. 第一步安裝on my zsh

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

     sudo chsh -s /bin/zsh
    
  3. 更換主題

    在命令行用vim打開用戶根目錄下.zshrc,我的修改爲agnoster:

    ZSH_THEME="agnoster"
    
  4. 安裝power-line字體

    # clone
    git clone https://github.com/powerline/fonts.git --depth=1
    # install
    cd fonts
    ./install.sh
    # clean-up a bit
    cd ..
    rm -rf fonts
    
  5. 設置字體高亮

    brew install zsh-syntax-highlighting
    

    打開zshrc配置文件追加

    open ~/.zshrc
    
    ##關鍵字高亮
    source $ZSH/oh-my-zsh.sh
    source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    #很多教程只有上邊那兩行,但是我們設置好編譯後發現關鍵字還是沒有高亮,這是因爲iTerm終端自身的原因,加上後面兩行代碼就可以將zsh中主題的顏色加載出來了
    export CLICOLOR=1
    export TERM=xterm-256color
    
  6. 下載ITeam2

    自己去官網下載

  7. 更換顏色

    打開ITerm2的設置頁面-Profiles-colors

    選擇Solarized-Dark

    image-20191115152142935

  8. 更換字體

    打開ITerm2的設置頁面-Profiles-Text

    選擇Meslo Lg L for PowerLine

    image-20191115152304240
    OVER

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章