23 Oct 2019

zsh配置

zsh配置

zsh香吗?

安装zsh

安装zsh

sudo apt install zsh

安装oh-my-zsh

wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh

设置zsh为默认shell

chsh -s /bin/zsh

如果要恢复到bash

chsh -s /bin/bash

更改主题

vi ~/.zshrc

找到ZS_THEME,更改主题

source ~/.zshrc

安装插件

  • 高亮插件

    cd ~/.oh-my-zsh/custom/plugins/
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
    vi ~/.zshrc
    在plugins添加zsh-syntax-highlighting(必须在最后一个)
    

    然后在.zshrc最后一行添加

    source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    

    保存退出

    source  ~/.zshrc
    
  • 命令补全

    cd ~/.oh-my-zsh/custom/plugins/
    git clone https://github.com/zsh-users/zsh-autosuggestions
    vi ~/.zshrc
    在plugins添加zsh-autosuggestions
    保存退出
    source  ~/.zshrc
    

Tags:
0 comments



本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议CC BY-NC-ND 4.0)进行许可。

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).