oh-my-zsh 安装及使用

什么是 oh-my-zsh

oh-my-zsh 是基于 zsh 的功能做了一个扩展,方便的插件管理、主题自定义,以及漂亮的自动完成效果。

oh-my-zsh 安装及插件安装

  • 查看系统中 zsh 及版本,若没有则安装 zsh
$ cat /etc/shells
$ zsh --version

# 如果系统中没有 zsh,则安装 zsh
$ sodu yum install zsh    (Fedora和RedHat以及SUSE中)
$ sodu apt-get install zsh    (Debian系列,Ubuntu )
$ brew install zsh zsh-completions (macOS)
  • 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

或者执行如下:

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  • 安装插件 zsh-autosuggestion, 此插件有智能补全
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
  • vi ~/.zshrc, 找到plugins=(git)这一行,然后再添加autosuggestions
plugins=(git zsh-autosuggestions)
  • source ~/.zshrc,生效配置

参考资料

https://github.com/robbyrussell/oh-my-zsh

https://blog.csdn.net/gatieme/article/details/52741221

猜你喜欢

转载自www.cnblogs.com/ronky/p/9896964.html