Mac下iTerm2 + Oh My Zsh配置個性化終端

Mac下iTerm2 + Oh My Zsh配置個性化終端

引用:

http://www.itdecent.cn/p/ba08713c2b19
https://www.iterm2.com/index.html

  1. 效果

WX20200527-160542.png
  1. 介紹

    1. iTerm2

      iTerm2是terminal的替代品,內(nèi)置很多豐富的功能,比如窗口分割、熱鍵、搜索、密碼管理等,讓你在使用中的體驗(yàn)更友好,效率更快。

      更多功能可以查看這里https://www.iterm2.com/features.html

    2. Oh My Zsh

      Oh My Zsh是一個zsh的管理配置工具,可以讓你在zsh中輕松的配置各種插件,比如布局、高亮、自動填充等

      更多插件可以查看這里https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

  2. 下載安裝

    官方地址 https://www.iterm2.com/

    1. 下載地址 https://www.iterm2.com/downloads.html 雙擊解壓 運(yùn)行iTerm程序,根據(jù)提示選擇將文件拷貝到application中,或者 brew install iterm2

    2. 配置顏色字體等

      1. 顏色

        iTerm2 -> Perferences -> Profiles ->Colors -> Color Presets -> Solarized Dark

      2. 字體(主題插件安裝完成之后再配置字體)

        iTerm2 -> Perferences -> Profiles -> Text -> Font -> MesloLGS NF

      3. 新窗口路徑與上一個窗口路徑一致

        iTerm2 -> Perferences -> Profiles -> General -> Working Directory -> Reuse previous session's directory

  3. 安裝Oh My Zsh

    官方地址 https://github.com/ohmyzsh/ohmyzsh

    1. curl方式安裝

      sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
      
  4. 安裝powerlevel10k主題插件

    官方地址https://github.com/romkatv/powerlevel10k

    Oh My Zsh方式安裝

    1. 下載文件到Oh My Zsh插件庫

      git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
      
    2. 編輯~/.zshrc文件

      ZSH_THEME="powerlevel10k/powerlevel10k"
      
    3. 修改字體為MesloLGS NF

    4. 重啟iTerm2

    5. 如果配置窗口沒有提示,使用以下命令

      p10k configure
      
  5. 安裝高亮顯示插件

    官方地址 https://github.com/zsh-users/zsh-syntax-highlighting

    Oh My Zsh方式安裝

    1. 下載文件到Oh My Zsh插件庫

      git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
      
    2. 編輯~/.zshrc文件,plugins增加zsh-syntax-highlighting插件

       plugins=( [plugins...] zsh-syntax-highlighting)
      
  1. 安裝自動填充建議插件

    官方地址 https://github.com/zsh-users/zsh-autosuggestions

    Oh My Zsh方式安裝

    1. 下載文件到Oh My Zsh插件庫

       git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
      
    2. 編輯~/.zshrc文件,plugins增加zsh-autosuggestions插件

       plugins=(zsh-autosuggestions)
      
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容