安装

  1. sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  2. # 开启自带跳转功能
  3. vim ~/.zshrc
  4. plugins=(git z)
  5. source ~/.bashrc
  6. # 生效
  7. source ~/.zshrc
  • 国内地区修改update地址
    1. cd ~/.oh-my-zsh
    2. git remote set-url origin https://gitee.com/mirrors/oh-my-zsh.git
    3. git pull

卸载

  1. uninstall_oh_my_zsh

插件

  • 自动补全插件 ```bash

    自动补全

    git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

    高亮

    git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

添加

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

  1. 如果粘贴比较慢,则添加配置
  2. ```bash
  3. # This speeds up pasting w/ autosuggest
  4. # https://github.com/zsh-users/zsh-autosuggestions/issues/238
  5. pasteinit() {
  6. OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
  7. zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
  8. }
  9. pastefinish() {
  10. zle -N self-insert $OLD_SELF_INSERT
  11. }
  12. zstyle :bracketed-paste-magic paste-init pasteinit
  13. zstyle :bracketed-paste-magic paste-finish pastefinish