日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

iTerm安装与配置

發布時間:2024/1/1 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 iTerm安装与配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

切換 Shell

打開默認終端,可以通過以下命令查看系統支持的 Shell 類型:

cat /etc/shells

查看當前 Shell 類型:

echo $SHELL

切換 Shell 類型:

chsh -s /bin/zsh

安裝 iterm2

🔗 官網下載解壓后拖入應用程序目錄。

或者使用 Homebrew 安裝:

brew install iterm2

優化配置

  • 沉浸式狀態欄:Preferences -> Appearance -> General。
    Theme:Minimal
    Tap bar location:Top
    Status bar location:Bottom

  • 隱藏側邊欄:Preferences -> Appearance -> Windows -> 勾選 Hide scrollbars。

  • Status bar 組件:Preferences -> Profiles -> Session -> 勾選 Status bar enabled -> Configure Status Bar -> 拖動組件,Auto-Rainbow 選擇 automatic。

  • 導入 🔗 Dracula 配色方案:
    導入:Preferences -> Profiles -> Color -> Color Presets… -> Import。
    選擇:Color Presets… -> Dracula。

  • 修改字體:🔗 Powerline 可以支持更多圖標。

    # 下載 git clone https://github.com/powerline/fonts.git --depth=1 # 安裝 cd fonts ./install.sh # 清理安裝文件 cd .. rm -rf fonts

    卸載時將上述步驟改為執行 uninstall.sh 文件即可。

    設置:Preferences -> Profiles -> Text -> Font。

  • 快捷喚出:
    Preferences -> Profiles -> Keys -> Configure Hotkey Window,設置快捷鍵,并勾選Floating Window。
    Preferences -> Profiles -> Windows -> Spaces,勾選 All Spaces。

  • Oh my zsh

    提高 zsh 的易用性,安裝:

    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # or sh -c "$(curl -fsSL https://gitee.com/goingta/xtool/raw/master/oh_my_zsh_install.sh)"

    顯示隱藏文件:Command + Shift + .

    目錄結構:

    .oh-my-zsh ├───plugins # 自帶插件,每個插件目錄下都有一個README使用說明 ├───themes # 自帶主題 └───custom # 用戶自定義├───plugins # 自定義插件└───themes # 自定義主題

    Oh my zsh 插件:

  • 🔗 autojump:通過 j 目錄名 快速進行目錄跳轉。必須先訪問目錄,然后才能跳轉。

    brew install autojump

    autojump 使用舉例。
    之前執行了:

    cd ~/Documents/Note

    現在可以:

    j Note

    還可以打開文件資源管理器窗口:

    jo Note

    另外:Oh my zsh 自帶的 z 插件,功能類似。

  • 🔗 zsh-autosuggestions:輸入時會灰字提示推薦命令,按鍵盤 ?? 補全。

    cd ~/.oh-my-zsh/custom/plugins git clone https://github.com/zsh-users/zsh-autosuggestions.git
  • 🔗 zsh-syntax-highlighting:語法高亮,輸入錯誤為紅色,正確為綠色,比如 cd、ls、clear 等。

    cd ~/.oh-my-zsh/custom/plugins git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
  • 自帶插件,參見 🔗 官方wiki。
    比如想用 sublime 打開一個文件:

    st ~/Documents/Note/mytext.txt
  • 打開配置文件:

    vim ~/.zshrc

    添加插件:

    # 找到 plugins=(git) # 改為 plugins=(git autojump zsh-autosuggestions zsh-syntax-highlighting sublime)

    修改主題:主題文件都在 ~/.oh-my-zsh/themes 目錄下,通過 ZSH_THEME="agnoster" 指定。

    使配置生效:

    source ~/.zshrc

    若每次新開啟一個終端都提示:

    zsh: command not found: mvn

    原因是 zsh 的配置文件沒有加載 ~/.bash_profile 的配置項。
    在 .zshrc 文件末尾加上:

    source ~/.bash_profile

    總結

    以上是生活随笔為你收集整理的iTerm安装与配置的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。