Linux 安装并配置zsh

1. 安装zsh,配置agnoster主题

1.1 安装zsh

$ sudo apt-get install -y zsh

1.2 安装oh-my-zsh

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

1.3 安装powerline font字体库

$ sudo apt-get install fonts-powerline

1.4 打开zsh配置文件 ~/.zshrc,修改主题为agnoster

1 # Set name of the theme to load --- if set to "random", it will
2 # load a random theme each time oh-my-zsh is loaded, in which case,
3 # to know which specific one was loaded, run: echo $RANDOM_THEME
4 # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
5 ZSH_THEME="agnoster"

1.5 将zsh设置为默认终端

$ chsh -s `which zsh`

1.6 注销,重新登陆

$ logout

2. 安装插件

2.1 进入插件路径

$ cd ~/.oh-my-zsh/plugins

2.2 下载自动补齐、高亮、建议插件

$ wget http://mimosa-pudica.net/src/incr-0.2.zsh
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
$ git clone https://github.com/zsh-users/zsh-autosuggestions
$ source incr*.zsh

2.3 修改配置文件

$ vi ~/.zshrc
1 plugins=(git
2 zsh-syntax-highlighting
3 zsh-autosuggestions)
4 
5 source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

猜你喜欢

转载自www.cnblogs.com/ezrealiu/p/11909152.html