oh-my-zsh 安装配置提高 shell 逼格


作为程序员一定要用高逼格的 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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容