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 fishAfter 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, runfisherto install all packages listed.
- omf: https://github.com/oh-my-fish/oh-my-fish
z, which is for smart jump:fisher install jethrokuan/znvm, 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/fontsbrew 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/shellsfile. - 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-autosuggestionsgit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightinggit clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvmgit 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-autosuggestionis 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
manpages and give suggestions, however theTABcompletion in fish on this is much more user friendly than thezshone. Also fish will parse themanpage exhaustively that all long or shorthand options are included. For exampletmux athen tab, fish will give many options likea/at/attach/attach-session, whilezshonly complete directly withattach. It is not easy to get the(themes likevi modeindicator showing up at the beginning of thepromptinzshcomparing to what's in fish.powerlevel10k/pure have this)- the async loading is tricky causing loading heavy plugins like
nvmis 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
zwill be expanded to an odd full command. - the
bindkeyis tricky that it has to work withzleand not easy to bind to things like vi normal mode. The part I miss in zsh for now is the transient prompt inpowerlevel10kwhich makes the terminal screen looks cleaner.