
1、官網(wǎng)下載
2、將iTerm2設(shè)為默認(rèn)終端:

3、給iTerm2設(shè)置全局快捷鍵:

4、配色:

5、安裝oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
如果shell沒有自動切換,可以執(zhí)行下面命令:
chsh -s /bin/zsh
6、修改主題
安裝oh-my-zsh成功后,用vim打開隱藏文件 .zshrc ,修改主題為 agnoster:
ZSH_THEME="agnoster"
應(yīng)用這個主題需要特殊的字體支持,否則會出現(xiàn)亂碼情況,這時我們來配置字體:
使用 Meslo 字體,點(diǎn)開連接點(diǎn)擊 view raw 下載字體。
安裝字體到系統(tǒng)字體冊。
按如下修改字體設(shè)置。

7、自動補(bǔ)全git命令
克隆倉庫到本地 ~/.oh-my-zsh/custom/plugins 路徑下,
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
用 vim 打開 .zshrc 文件,找到插件設(shè)置命令,默認(rèn)是 plugins=(git) ,我們把它修改為,
plugins=(zsh-autosuggestions)
8、語法高亮
使用homebrew安裝 zsh-syntax-highlighting 插件,
brew install zsh-syntax-highlighting
配置.zshrc文件,插入一行,
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
輸入命令,
source ~/.zshrc
9、隱藏shell終端前的xx@xx
修改~/.oh-my-zsh/themes下的主題文件,
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
# 注釋掉這里
#prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_end
}
10、配置vim顏色
先查看vim下是否有配色
ls /usr/share/vim/vim73/colors

然后再用戶目錄下創(chuàng)建 .vimrc文件,輸入如下
vim ~/.vimrc
set nu
colorscheme desert
syntax on
補(bǔ)充:
2018年5月25日:
自動換行:在用戶配置文件中添加word_wrap屬性,設(shè)置為ture:
"word_wrap": "true",
2018年5月26日
快捷鍵:
新建標(biāo)簽:command + t
關(guān)閉標(biāo)簽:command + w
切換標(biāo)簽:command + 數(shù)字 command + 左右方向鍵
切換全屏:command + enter
查找:command + f
垂直分屏:command + d
水平分屏:command + shift + d
切換屏幕:command + option + 方向鍵 command + [ 或 command + ]
查看歷史命令:command + ;
查看剪貼板歷史:command + shift + h
清除當(dāng)前行:ctrl + u
到行首:ctrl + a
到行尾:ctrl + e
前進(jìn)后退:ctrl + f/b (相當(dāng)于左右方向鍵)
上一條命令:ctrl + p
搜索命令歷史:ctrl + r
刪除當(dāng)前光標(biāo)的字符:ctrl + d
刪除光標(biāo)之前的字符:ctrl + h
刪除光標(biāo)之前的單詞:ctrl + w
刪除到文本末尾:ctrl + k
交換光標(biāo)處文本:ctrl + t
清屏1:command + r
清屏2:ctrl + l
2018年8月18日
關(guān)于item終端設(shè)置:

- 當(dāng)添加智能提示輸入時,只顯示一個提示符;
- vim會提示鼠標(biāo)滾輪自動滑動;
參考:
https://www.cnblogs.com/xishuai/p/mac-iterm2.html
https://blog.csdn.net/thinkdiff/article/details/25075047