Linux安装zsh

  1. 安装zsh

    注意:需要先安装git

    yum -y install zsh 
    wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
    
  2. 切换到zsh模式

    zsh
    
  3. 安装插件 zsh-syntax-highlighting

    cd /root/.oh-my-zsh/custom/plugins
    git clone https://gitee.com/pankla/zsh-syntax-highlighting.git
    
    git clone https://hub.fastgit.org/zsh-users/zsh-syntax-highlighting.git
    
  4. 安装插件 zsh-autosuggestions

    cd /root/.oh-my-zsh/custom/plugins
    git clone https://gitee.com/pankla/zsh-autosuggestions.git
    
    git clone https://hub.fastgit.org/zsh-users/zsh-autosuggestions
    
  5. 安装插件 zsh-completions

    cd /root/.oh-my-zsh/custom/plugins
    git clone https://gitee.com/wangnd/zsh-completions.git
    
  6. 修改文件 /root/.zshrc

    vim /root/.zshrc
    

    修改主题:

    ZSH_THEME="agnoster"
    

    添加相关插件

    plugins=( git zsh-syntax-highlighting zsh-autosuggestions zsh-completions)
    

    添加命令别名

    alias sz='source /root/.zshrc'
    

    添加按键映射

    bindkey "\e[1~" beginning-of-line
    bindkey "\e[4~" end-of-line
    bindkey "\e[5~" beginning-of-history
    bindkey "\e[6~" end-of-history
    bindkey "\e[3~" delete-char
    bindkey "\e[2~" quoted-insert
    bindkey "\e[5C" forward-word
    bindkey "\eOc" emacs-forward-word
    bindkey "\e[5D" backward-word
    bindkey "\eOd" emacs-backward-word
    bindkey "\ee[C" forward-word
    bindkey "\ee[D" backward-word
    bindkey "^H" backward-delete-word
    
    bindkey "\e[8~" end-of-line
    bindkey "\e[7~" beginning-of-line
    
    bindkey "\eOH" beginning-of-line
    bindkey "\eOF" end-of-line
    
    bindkey "\e[H" beginning-of-line
    bindkey "\e[F" end-of-line
    
    bindkey '^i' expand-or-complete-prefix
    

    让配置文件生效

    source /root/.zshrc
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值