Post banner

Since I last wrote about Fish (the Friendly Interactive SHell), I’ve become a full-on convert. I actually stumble a bit when I use Bash now, with so many nice Fish features ingrained in my muscle memory. Did you know that Fish records command history per-directory and offers the appropriate completion based on your current working directory? It’s an amazingly productive feature.

I’ve updated the GitHub repo that holds all of my Fish configurations and functions. The ones worth sharing publicly, anyway. “Worth sharing” is subjective, your need will depend on how much better at Fish you are than me. If you’re getting started with Fish, it might be a good place to see some of my own exploration and learning.

Over the last few months I haven’t had to do a lot of further tweaking, but I’ve made some changes worth keeping the repo up to date with.

I improved all of the completion functions that work with open -a and various Mac applications. They were great if the file you wanted to open was in the current folder, but there was no ability to navigate to subfolders (and still have completion). My new solution isn’t perfect, but it’s much improved. Now if I use my Xcode shortcut in Marked’s code directory, xc M<tab> will show me completions starting with Marked.xcodeproj but also make all directories available to tab into. It still fails if you try to prefix an absolute path to the argument, but for the current directory and subdirectories, it works great. And that’s 99% of how I use them, so problem solved for me.

I added new bash ports and completions for some of my own utilities, including an improved tm tmux wrapper, better doing completion, and ports of im (a doing shortcut) and my logr script. The latter works great as a shortcut for logger with simplified syntax, but the Fish version lacks the ability to echo verbosely to STDOUT, and is missing the Bash functionality where a “debug” level message was able to automatically determine the path to the calling function and include a pretty func in the log. But it serves its purpose well. That one’s not a complex script, and I may get around to rewriting it in Fish and restoring the missing functionality.

A few functions were added and updated, the highlights being:

  • 64svg: New: encode a given svg file as base64 and output css background-image property to clipboard
  • dadjoke: New: Get a dad joke from icanhazdadjoke.com
  • md: New: Test if current directory is bookmarked (works with marks plugin)
  • gitar: Improved: Automatically add new and remove deleted files from the git index, now cds to top level and restores working directory on completion

If you use Terminal regularly and are open to exploring a new shell, I highly recommend giving Fish a shot. It beats Bash pretty easily (subjective opinion), and goes head to head with Zsh. And the niceties, like sane scripting, automatic completion suggestions (without needing tab), and cycling of tab completions with fuzzy matching (just to name a few) make it a pleasure to use. I’m all Fish all the time these days.

Here’s the fish_files repo link again, just in case you’re on your way to check it out right now.