一些常用的zsh插件

2020-02-24  本文已影响0人  wangxinalex

安装zsh

brew install zsh

安装oh-my-zsh

https://github.com/robbyrussell/oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

zsh插件

auto-suggestions

https://github.com/zsh-users/zsh-autosuggestions

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=(zsh-autosuggestions)
  1. Start a new terminal session.

zsh-syntax-highlighting

https://github.com/zsh-users/zsh-syntax-highlighting

  1. Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-syntax-highlighting)
  1. Restart zsh (such as by opening a new instance of your terminal emulator).

zsh-history-substring-search

https://github.com/zsh-users/zsh-history-substring-search

  1. Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
  1. Activate the plugin in ~/.zshrc:
plugins=( [plugins...] history-substring-search)
  1. Source ~/.zshrc to take changes into account:
source ~/.zshrc
  1. Bind keyboard shortcuts to this script's functions.
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

z

just add z to the plugins array in .zshrc

plugins=( [plugins...] z )
上一篇下一篇

猜你喜欢

热点阅读