mac终端oh-my-zsh配置

in macOS with 0 comment

查看当前终端使用的shell

echo $SHELL

查看安装的shell

cat /etc/shells

使用brew更新zsh

brew install zsh

安装oh-my-zsh

从GitHub下载安装脚本

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

也可以直接从对应的文件夹里拷贝这个文件的源码,然后执行 sh install.sh来安装

安装完成之后可以编辑oh-my-zsh的配置文件

vim ~/.zshrc

~/.oh-my-zsh/custom/plugin 目录下新建 incr 目录,下载incr自动补全插件,放在incr目录下,配置里面添加如下配置

source $ZSH/oh-my-zsh.sh
source $ZSH/custom/plugins/incr/incr*.zsh

安装语法高亮插件 zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

然后再在 plugin配置项里添加 zsh-syntax-highlighting

安装终端提示自动补全插件 zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

然后再在 plugin配置项里添加 zsh-autosuggestions

安装zsh-nvm

git clone https://github.com/lukechilds/zsh-nvm.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-nvm

然后再在 plugin配置项里添加 zsh-nvm

安装wd

git clone https://github.com/mfaerevaag/wd.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/wd

然后再在 plugin配置项里添加 wd

Responses