sudo apt-get install -y zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
执行这条语句:
chsh -s `which zsh`
然后重新登录系统即可
需要在配置文件~/.zshrc中设置
ZSH_THEME="ys"
重启zsh即可,或者直接更新源
source ~/.zshrc
该主题需要安装字体库
sudo apt-get install fonts-powerline
# 清理一下字体缓存
fc-cache -vf
# 查一下字体是否生效了
fc-list
是插件autosuggest导致的,需要设置
# 解决卡顿问题
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
或者是git导致的需要设置
git config --global oh-my-zsh.hide-status 1
然后在/.oh-my-zsh/plugins/incr路径下执行终端指令
source incr*.zsh
末尾添加
# 自动补全插件
source ~/.oh-my-zsh/plugins/incr/incr*.zsh
最后更新源
source ~/.zshrc
设置~/.zshrc
,把zsh-autosuggestions
添加到 Oh My Zsh 要加载的插件列表中
# 这里也添加了mvn插件
plugins=(git zsh-autosuggestions mvn)
最后更新源
source ~/.zshrc
插件地址sh-syntax-highlighting 安装方法与4.3一样,不再赘述
插件地址zsh-completions
需要在配置.zshrc中添加对应的设置