1. 安装zsh
- Shell是在程序员与服务器间建立一个桥梁,它对外提供一系列命令,让我们得以控制服务器。常用的Bash就是Shell的一种,也是Linux下默认Shell程序。
查询shell
安装zsh
- 使用以下命令安装zsh 【这里仅以debain及其衍生版作为例子】
2. 切换为zsh
1 2
| chsh -s /usr/bin/zsh //根据自己的zsh所在地址进行切换 // 然后输入你的账户密码
|
3. 安装oh-my-zsh
- Zsh虽然好用,但直接用起来比较麻烦,但是已经有大神配置好的框架:oh-my-zsh,专门为Zsh打造的
1 2 3 4 5 6
| >$ cd ~ >$ mkdir .oh-my-zsh >$ cd .oh-my-zsh >$ git clone https://github.com/ohmyzsh/ohmyzsh.git ./ >$ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc >$ source ~/.zshrc
|
眼前一亮, 感觉世界充满了颜色
4. 配置主题
oh-my-zsh自带100多个主题,主题的配置文件在 ~/.zshrc文件中,找到这一行:
1
| >ZSH_THEME="robbyrussell"
|
你可以将值改成任意主题,oh-my-zsh的主题可以在这里找到。保存好文件后,执行 source ~/.zshrc 使配置生效。如果你将值设为空,表示不使用任何主题;你也可以设置为”random”,你每次打开都会随机选择一个主题。
推荐主题: bira
5. 安装插件
1
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
|
- 自动补全插件 zsh-autosuggestions
1
| git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
1 2 3 4 5 6
| git clone git://github.com/joelthelion/autojump.git cd autojump ./install.py
vim ~/.bashrc [[ -s /home/misfit/.autojump/etc/profile.d/autojump.sh ]] && source /home/misfit/.autojump/etc/profile.d/autojump.sh
|
1 2 3 4 5 6 7 8 9 10
| vim ~/.zshrc
plugins=( git autojump zsh-autosuggestions zsh-syntax-highlighting )
source ~/.zshrc
|
参考链接
参考链接一
参考链接二
参考链接三