1. iTerm2
1.1 iTerm2安裝
直接在其官方的下載地址進行下載:https://www.iterm2.com/downloads.html,下載的直接就是一個 .app 的應用程序,直接拖到 Application
文件夾即可;
或者在終端使用下面的指令安裝:
$ brew cask install iterm2
1.2. iTerm2配置
1.2.1 將iterm2設置成默認使用的終端軟件
打開iterm2,在左上角的菜單欄依次點擊:iTerm2->Make ITerm2 Default Term
1.2.2 設置全局熱鍵
打開iterm2的偏好設置iTerm2->Preferences
,勾選Keys->Hotkey
下的Show/hide iTerm2 with a system-wide hotkey
,將熱鍵設置為你喜歡的(比如command + .
) ,這樣你就可以通過設置的全局熱鍵來打開或關閉iTerm2窗口,非常方便
1.2.3 改變光標形狀
在 Preperence → Profiles → Text
進行設置。
1.2.4 iterm2 配色方案
網上有現成的配色方案,我們可以直接拿來主義,地址在這里:https://iterm2colorschemes.com/。
下載壓縮包,解壓后,打開 iTerm2 的設置:Preperence → Profiles → Colors → Color Presets
。點擊 import
選擇解壓好的主題目錄下 schemes
目錄下的你想要的主題導入。
導入之后,再選擇你想要的主題就好了。
還有很多設置,比如背景圖什么,可以直接百度進行配置。
2. oh-my-zsh
github連接:https://github.com/robbyrussell/oh-my-zsh
也可以使用curl安裝:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
安裝成功后,在命令行用vim打開用戶根目錄下.zshrc,修改主題為你喜歡的,我修改為ys:
ZSH_THEME="ys"
2.1 自動補全插件 zsh-autosuggestions
clone插件到oh-my-zsh的插件目錄/Users/xxxx/.oh-my-zsh/plugins
:
git clone https://github.com/zsh-users/zsh-autosuggestions.git
編輯.zshrc文件,找到plugins=(git)這一行,如果沒有添加。更改為如下:
plugins=(git zsh-autosuggestions)
2.2 高亮插件zsh-syntax-highlighting
安裝方式和上面的一樣。
地址:
https://github.com/zsh-users/zsh-syntax-highlighting.git
插件很多,就不一一列舉了,安裝方式都是一樣的。