都说普通青年用bash,装逼青年用zsh,文艺青年用fish。fish是真的好用,但是它最大的问题是与bash不兼容,从而带来各种各样兼容性问题,折腾过fish的人都知道。而zsh有着可定制化的oh-my-zsh框架,同时又是兼容bash语法的,笔者在这里记录一下如何安装一个oh-my-fishy-zsh。
⚡ root@gens-virtual-machine ~ uname -a
Linux gens-virtual-machine 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
⚡ root@gens-virtual-machine ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
apt-get install zsh curl git autojump
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
~/.zshrc
安装完oh-my-zsh的下一步就是自定义配置文件,下面罗列了一些模仿fish必备的插件
zsh主题选择fishy,可以模仿fish特有的路径简写模式。
ZSH_THEME="fishy"
本人更喜欢
agnoster
主题所以就改了,默认主题路径:~/.oh-my-zsh/themes
如果想每次登录shell显示的主题随机,则配置文件改为:ZSH_THEME="random"
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
z
history-substring-search
command-not-found
colored-man-pages
extract
history-search-multi-word
)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
git clone https://github.com/zdharma/history-search-multi-word ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/history-search-multi-word
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:oh-my-fishy-zsh配置