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 autojumpautojump 使用舉例。
之前執行了:
現在可以:
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 打開一個文件:
打開配置文件:
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 文件末尾加上:
總結
以上是生活随笔為你收集整理的iTerm安装与配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 血饮龙城--ios技术支持
- 下一篇: 透镜成像规律(转自百度百科)