mac终端oh-my-zsh配置 Published on Dec 3, 2020 in mac with 0 comment 查看当前终端使用的shell ```bash echo $SHELL ``` 查看安装的shell ```bash cat /etc/shells ``` 使用brew更新zsh ```bash brew install zsh ``` ## 安装[oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) 从GitHub下载安装脚本 ```bash sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` > 也可以直接从对应的文件夹里拷贝这个文件的源码,然后执行 `sh install.sh`来安装 安装完成之后可以编辑oh-my-zsh的配置文件 ```bash vim ~/.zshrc ``` 在 `~/.oh-my-zsh/custom/plugin` 目录下新建 `incr` 目录,下载incr[自动补全插件](http://mimosa-pudica.net/src/incr-0.2.zsh),放在incr目录下,配置里面添加如下配置 ```bash source $ZSH/oh-my-zsh.sh source $ZSH/custom/plugins/incr/incr*.zsh ``` ## 安装语法高亮插件 [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) ```bash 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](https://github.com/zsh-users/zsh-autosuggestions) ```bash git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ``` 然后再在 `plugin`配置项里添加 `zsh-autosuggestions` ## 安装[zsh-nvm](https://github.com/lukechilds/zsh-nvm) ```bash git clone https://github.com/lukechilds/zsh-nvm.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-nvm ``` 然后再在 `plugin`配置项里添加 `zsh-nvm` ## 安装[wd](https://github.com/lukechilds/zsh-nvm) ```bash git clone https://github.com/mfaerevaag/wd.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/wd ``` 然后再在 `plugin`配置项里添加 `wd` 本文由 tutustack 创作,采用 知识共享署名4.0 国际许可协议进行许可本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名