iterm2
iterm2 偏好設置
- 打開偏好設置
- 通用 – 啓動
- 通用 – 關閉
- 通用 – 選擇
- 通用 – 窗口
- 外觀 – 通用
- 外觀 – 窗口
- 外觀 – 標籤
- Profiles – 通用
- Profiles – Colors
Basic Colors:
Foreground:00c200
Selection:235c03
Cursor Colors:
Cursor:235c03
Cursor text:00c200
- Profiles – Text
- Profiles – Windows
- Profiles – Terminal
iterm2 安裝 homebrew
-
安裝
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- 安裝驗證
oh my zsh 安裝
-
安裝
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Powerline 安裝
➜ ~ pip3 install powerline-status --user
zsh 配置
- vim 語法高亮配置
➜ ~ cp /usr/share/vim/vimrc ~/.vimrc # 複製配置文件
➜ ~ echo 'syntax on' >> ~/.vimrc # 追加語法高亮配置
- 驗證效果
➜ ~ vim ~/.zshrc
- 關閉 zsh 自動更新
# DISABLE_UNTRACKED_FILES_DIRTY="true" # 取消註釋即可
- zsh 主題設置 – 主題目錄
➜ ~ ls ~/.oh-my-zsh/themes
- zsh 主題設置 – 主題配置
➜ ~ vim ~/.zshrc
# ZSH_THEME="robbyrussell" # 默認主題
ZSH_THEME="agnoster" # 按照需求修改主題
- zsh 主題設置 – 刷新配置信息
➜ ~ source ~/.zshrc
- zsh 主題設置 – 安裝 powerline 字體
cd Desktop && git clone https://github.com/powerline/fonts.git # 下載
cd fonts && ./install.sh # 進入目錄 && 安裝
cd .. && rm -rf ./fonts # 刪除下載文件
- zsh 主題設置 – 字體設置
- zsh 主題設置 – 字體修改後效果
- zsh 主題設置 – 變量提示信息更改
vim ~/.oh-my-zsh/themes/agnoster.zsh-theme
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
# prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m" # 註釋掉
fi
}
- zsh 主題設置 – 刷新配置(目錄提示修改)
source ~/.zshrc
zsh 插件安裝
- zsh 插件安裝 – 本地插件信息
ls ~/.oh-my-zsh/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- zsh 插件安裝 – 添加到配置文件
vim ~/.zshrc
plugins=(git) # 修改前
plugins=(git zsh-syntax-highlighting zsh-autosuggestions) # 修改後
- zsh 插件安裝 – 刷新配置
source ~/.zshrc
- zsh 插件安裝 – 驗證
zsh-syntax-highlighting:
輸入正確的常用命令會以綠色高亮顯示,輸入錯誤則會顯示其他的顏色。
zsh-autosuggestions:
輸入命令時,會用淺色字體給出建議的命令,按 → 即可自動補全。