Either do brew install fish
or download the installer from https://fishshell.com/
.
sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt install fish
After installation, type fish
in terminal to enter the shell.
Both fihserman and oh-my-fish are good.
- fisherman: https://github.com/jorgebucaran/fisher
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
- the package list file is in
~/.config/fish/fishfile
, runfisher
to install all packages listed.
- omf: https://github.com/oh-my-fish/oh-my-fish
z
, which is for smart jump:fisher install jethrokuan/z
nvm
, node version manager:fisher install jorgebucaran/fish-nvm
.bd
, smart dir backfisher install 0rax/fish-bd
- Theme that shows git information/context
- This requires powerline font. check out the repo and run
install.sh
- another option is use the nerd font to get more fancy.
brew tap caskroom/fonts
brew cask install font-meslo-nerd-font
- set -U theme_nerd_fonts yes
- another option is use the nerd font to get more fancy.
- Bob-the-fish theme:
fisher install oh-my-fish/theme-bobthefish
. - Another Famous 'agnoster' theme:
fisher install oh-my-fish/theme-agnoster
. - a jorgebucaran theme which does async git, good for large repository:
fisher install jorgebucaran/hydro
. - tide theme similar to powerline10k:
fisher install IlanCosman/tide@v6
, which implements the transient prompt.
- This requires powerline font. check out the repo and run
- More packages can be found in this awesome-fish repo
- run below command to set the encoded password on ENV.
set -xU pw (echo -n (security find-generic-password -wa (whoami)) | base64)
- run below commands to set proxy on ENV
set -xU http_proxy http://$USER:(echo $pw | base64 --decode)@proxy.YouCompany.com:8099 set -xU https_proxy $http_proxy set -xU no_proxy localhost,127.0.0.1 set -xU HTTP_PROXY $http_proxy set -xU HTTPS_PROXY $http_proxy
- use the custom function mentioned below to set pw when renew password or on/off proxy.
- Fish config file is under
~/.config/fish/config.fish
, Example - custom function can be created under
~/.config/fish/functions/
. Example, where functions like setpw/setproxy/unsetproxy can be used when password change or activate/deactivate proxy. - FZF Env vars
set -Ux FZF_DEFAULT_COMMAND 'rg --files --hidden'
set -Ux FZF_DEFAULT_OPTS '--height 75% --multi --reverse --bind ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-f:preview-page-down,ctrl-b:preview-page-up,ctrl-y:preview-up,ctrl-e:preview-down'
- add fish path(for example
/usr/local/bin/fish
) to the/etc/shells
file. - run
chsh -s /usr/local/bin/fish
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
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-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
git clone https://github.com/lukechilds/zsh-better-npm-completion ~/.oh-my-zsh/custom/plugins/zsh-better-npm-completion
The advantage of zsh
is its POSIX
compatibility. However for a user shell in personal computer, I still think that is not that important as long as we are not writing scripts for other user/application. Fish's
out of box configure is super. Other than the Long configuration of zsh
, there are still some feature gap there.
- The
zsh-autosuggestion
is not context-aware meaning that it cannot give relevant information based on what directory you are, which is quite handy. It is tracked by this zsh github issue - both shells are able to parse the
man
pages and give suggestions, however theTAB
completion in fish on this is much more user friendly than thezsh
one. Also fish will parse theman
page exhaustively that all long or shorthand options are included. For exampletmux a
then tab, fish will give many options likea/at/attach/attach-session
, whilezsh
only complete directly withattach
. It is not easy to get the(themes likevi mode
indicator showing up at the beginning of theprompt
inzsh
comparing to what's in fish.powerlevel10k
/pure have this)- the async loading is tricky causing loading heavy plugins like
nvm
is really slow(>1s). - the alias expansion is all or nothing which is not super convenient. things like git/nvim are good but aliases like the
z
will be expanded to an odd full command. - the
bindkey
is tricky that it has to work withzle
and not easy to bind to things like vi normal mode. The part I miss in zsh for now is the transient prompt inpowerlevel10k
which makes the terminal screen looks cleaner.