一些常用的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
- 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
- Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=(zsh-autosuggestions)
- Start a new terminal session.
zsh-syntax-highlighting
https://github.com/zsh-users/zsh-syntax-highlighting
- 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
- Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-syntax-highlighting)
- 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
- 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
- Activate the plugin in ~/.zshrc:
plugins=( [plugins...] history-substring-search)
- Source ~/.zshrc to take changes into account:
source ~/.zshrc
- 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 )