Homebrew didn't work last time I tried. You might have better luck:
brew install fish
Otherwise:
git clone git://github.com/fish-shell/fish-shell.git
cd fish-shell
autoconf && ./configure && make && make install
Then, to set it as your default shell:
sudo sh
echo "/usr/local/bin/fish" >> /etc/shells
exit
chsh -s /usr/local/bin/fish
-
Colouring. Executables and Functions are blue, arguments are cyan, errors are red, and more.
-
Always in reverse-incremental-search mode
-
Completes pathnames, executables, and options from manpages.
Setting environment variables is very different.
# bash
export RAILS_ENV=test
# fish
set -x RAILS_ENV test
#bash
RAILS_ENV=test rake ...
# fish
set RAILS_ENV test ; rake ...
# bash
unset RAILS_ENV
# fish
set -e RAILS_ENV
Fish also has Universal environment variables. These are synchronized automatically between all running fish sessions on a machine. To use these:
set -Ux VAR value
set -Ue VAR
Control structures are somewhat different too:
# bash
for i in *; do echo $i; done
# fish
for i in *; echo $i; end
# bash
if [ 1 ] ; then echo hi ; fi
# fish
if [ 1 ] ; echo hi ; end
Subshells too:
# bash
for i in `ls foo` ; ...
for i in $(ls foo) ; ...
# fish
for i in (ls foo) ; ...
And &&
and ||
don't exist:
# bash
autoconf && ./configure
# fish
autoconf ; and ./configure
# bash
make || do_failed
# fish
make ; or do_failed
Aliases are functions in fish. You can edit them live with the funced funcname
command, and save them to ~/.config/fish/functions
-- which is preloaded on shell init -- by using funcsave functionname
.
fish_config
shows a goofy web configuration thing that I don't have much use for.
Or add this to ~/.config/fish/config.fish
for rbenv.
set PATH $HOME/.rbenv/shims $PATH
set PATH $HOME/.rbenv/bin $PATH
rbenv rehash >/dev/null ^&1
See my config
There’s fishfish on Homebrew now