作为程序员一定要用高逼格的 shell。
安装 zsh
macOS
brew install zsh zsh-completions
Ubuntu & Debian
sudo apt-get install zsh
安装 oh-my-zsh
via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
via wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
推荐插件安装
zsh-autosuggestions
命令的自动补全提示
cd ~/.oh-my-zsh/plugins
git clone git://github.com/zsh-users/zsh-autosuggestions
history-substring-search
根据 shell 输入历史搜索,命令自动补全提示
oh-my-zsh 自带插件
zsh-syntax-highlighting
可执行命令语法高亮
cd ~/.oh-my-zsh/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
修改 .zshrc 添加插件
vim ~/.zshrc
修改 plugins=(git) 为 plugins=(git zsh-autosuggestions history-substring-search zsh-syntax-highlighting)
source ~/.zshrc 使配置生效
默认使用 zsh
vim ~/.bashrc
添加如下内容到 .bashrc 中
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi