Switching from Zsh to fish


Notice from 2015: Nowadays I don't use bash, fish or zsh, nowadays I use good old (m)ksh because it's POSIX compliant and really fast.

In this post I'll be talking about my experience with switching from zsh (Z shell) to fish (Friendly Interactive shell). I'm not gonna talk about how or why it's better than the other shells, I'm only gonna talk about the process of switching for me.

Where to start... well, how about starting with the fact that I tried to do the switch before? I did try to do the switch before, I don't remember exactly what problems I had last time but I'm pretty sure it was something with Vim or something.

I decided to try the switch again taking advantage of the fact that a new version had been released recently (v2.1.0). Seemed like a good idea to try again, also the fact that I like the features it has, of course.

The switch wasn't as problem-free as I wished but it was quite a smooth process.

First, I was running across problems with Vim which I imagine I wasn't able to solve last time, but I solved this time. The problem was a startup error that Vim was complaining about not finding a certain file or something. I just had to add the following to the top of my .vimrc file to fix it:

if $SHELL =~ 'fish'
    set shell=/bin/sh

Basically, if Vim can detect the $SHELL variable is fish it'll tell Vim to interact with the current shell as if it was sh. As I understand it, don't take my word for it. That fixed that.

Another problem I was running into was that Emacs was complaining about not being able to find the package.el file. The reason for the error was that I was opening an old version of Emacs (v22.x). This was just a matter of updating the $PATH variable, that was done with the following line of code in my config.fish file:

set PATH /usr/local/bin /usr/local/sbin /usr/local/share/npm/bin /usr/local/opt/ruby/bin $HOME/bin $HOME/.tmuxifier/tmuxifier/bin $PATH

Umm... Those were the only real note-worthy parts. The rest were just a matter of translating zsh to fish.