So, out of boredom, I decided to upgrade my shell and terminal to something closer to 2017, instead of living in the early 90s. Clearly I’e been using
bash
all these years - mostly on Ubuntu and lately on OSX. But I’ve always been lazy and complacent with the terminal. I’ve always wanted to set up fish
- Friendly Interactive SHell. for it’s git integration, and very rich interaction. Sure, all of this can be done on bash
or zsh
but I hate configuration, and combing hundreds of git repos for bashfiles
and find what works for me.The fish shell is a modern command-line shell that aims to be more discoverable and less beholden to tradition than other shells like bash and csh. Among its many unique features are on-the-fly syntax highlighting of the command line, as well as tab completion for everything under the sun with descriptions for each possible completion. The Fish shell goes where few command-line shells have gone before, shedding its forebearers’ POSIX baggage in favor of simplicity, consistency, and ease-of-use. Much like the Mac creators thought computers should be made to understand how humans work (and not the other way around), Fish observes your past behavior and suggests commands that.
While at
fish
, I also decided to upgrade the default Mac terminal
to iTerm2
. This led me to a journey through installing fonts all the way to picking up the theme that works for me. But again, no configuration to mess with.Installing fish
Since I have brew, I was able to simply do this
If you do not have brew, head over to fishshell.com for instructions on setting it up. They have MacPorts, Installer, and an executable. Sonos for mac.
Once installed, the default theme supports git repositories, in that, the prompt indicates the local repository state, has nice syntax highlighting on the command line, and typical things you’d expect from the shell of the 21st century.
You can see the prompt change, as well as a timestamp show up to the right of the window.
If you wish to make fish your default shell, add add
/usr/local/bin/fish
at the very top of /etc/shells
, and execute chsh -s /usr/local/bin/fish
. If not, then you can always type fish
in bash
.Installing omf
Given the richness of fish with themes and plugins, it’s best to use
omf
- Oh My Fish, which is more or less a package manager for fish.To install
omf
-Once
omf
is installed, checking out themes etc. becomes a breeze. To do so, type omf
on the prompt to see the options. Typing omf theme
will show a big list, and in order to see what these themes look like, head over here to preview them.I liked
bobthefish
, and installed it like so -You can always switch back to
default
by typing omf theme default
. You can install many themes and switch back and forth between them till you’re comfortable with one of them.However, this theme (and many others) uses fonts that would need to be installed.
Installing Powerline Patched Fonts
Feel free to remove the
fonts
directory.Installing iTerm2
Downloaded and installed iTerm2, which is super simple to do.
Take a look at the Font Book, and pick the powerline font of your choice. I like
Ubuntu Mono
. You can type powerline
in the little search textbox in Font Book to shorten the list. Once picked, set the font here -Restart iTerm2, and you should be all set!
Fish Shell For Mac Computers
Github integration
This image shows how the prompt changes as we make simple changes to a local git repo. I am using
bobthefish
theme. See the theme details on how the prompt indicates various states like locally committed but un-pushed changes, etc.Fish Shell Default Mac
As you can see, it is super helpful, with no configuration to get this going. This to me is one of the most useful and powerful features of
fish
.Fish Shell For Mac Osx
Now that you have
fish
and omf
set up, play with the many options and if you have never used it before, you’ll be surprised how modern and developer friendly this set up is. The depth of autocomplete going beyond just file names, auto-suggestion, history navigation, and syntax coloring makes working on the terminal so much productive and painless!