1. 切換爲zsh環境
切換至zshchsh -s /bin/zsh
,並重啓終端
2. 安裝oh my zsh
執行下列命令之一:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
oh my zsh 官網:https://ohmyz.sh/
3. 安裝並配置常用插件
zsh-autosuggestions
:根據歷史記錄補全命令zsh-syntax-highlighting
: 語法高亮插件
首先下載到~/.oh-my-zsh/plugins
目錄下
cd ~/.oh-my-zsh/plugins
git clone git://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
git clone https://github.com/paulirish/git-open.git
配置.zsh文件
plugins=(
git
zsh-autosuggestions # 根據歷史輸入指令的記錄即時的提示
zsh-syntax-highlighting # 命令高亮
extract # 用 x filename 解壓文件
git-open # git open 在瀏覽器中打開遠程倉庫
colored-man-pages
z # 模糊跳轉
)
4. 其他技巧
在mac中做如下設置來方便地打開文件,個人配置了兩個app分別是visual studio code
和textmate
.在.zshrc
下做如下配置
alias text='open -a textmate'
alias vscode='open -a visual\ studio\ code'
使用方法如下
$ text ~/.zshrc
$ vscode ~/.zshrc