Linux 安装并配置zsh

Posted 袁克波

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于Linux 安装并配置zsh的主要内容,如果未能解决你的问题,请参考以下文章

Linux终端配置——zsh+插件优化

在 Linux Mint 19 上安装 zsh 和设置小键盘一步到位

如何编辑 zsh 的配置文件/.zshrc

ubuntu 安装并配置zsh

linux下安装oh-my-zsh

Linux 下安装使用 oh-my-zsh