linux和macOS安装oh my zsh

2020-07-22  本文已影响0人  thepoy
效果图

1、如果没有安装zsh的请先安装zsh

debian系通常默认未安装zsh,arch系一般预装zsh。

sudo apt install zsh

如果arch系没有zsh,也安装一下:

sudo pacman -S zsh

macOS默认用的就是zsh,不需要再安装。

2、使用官方脚本安装oh my zsh,下面两条命令任选其一

curl

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

wget

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

一路yes即可。

3、安装历史命令提示插件

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

4、安装高亮插件

git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

5、修改.zshrc

在文件里找到plugins,修改为

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

6、生效配置

source .zshrc
上一篇 下一篇

猜你喜欢

热点阅读