macOS terminal setup to boost your productivity

This post is not intended to show my complete terminal setup, but to provide you with the best tools out there, which I’ve found after some research and experience. I love doing stuff in the terminal and it’s a major part of my work day as a web developer. If you do too, then I hope you’ll find some useful things here.

The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting. Zsh is an extended Bourne shell with a large number of improvements, including some features of GNU Bourne Again SHell, ksh, and tcsh.
Alternatively, you can use fish (Friendly Interactive SHell) which is an attempts to be more interactive and user-friendly than former shells. The goal is to give the user a rich set of powerful features.

Now that we’ve got zsh up and running, it’s time to customize it! You’re probably ready to fire up Vim or GNU Emacs (or GNU nano, I don't judge) and start editing config files but wait for a second, I’ll try to save you some time. Oh-my-zsh is a set of functions, auto-complete helpers, and other useful stuff. Also, it is a very good framework for further customizations.

Oh-my-zsh comes with a handful of plugins for different apps – Git, Ruby, Ruby on Rails, gem and a lot more. Every plugin has a set of aliases, auto-complete helpers and functions. For example, you can type gst for git status, or type rdbm for rake db:migrate, db:test:clone and so on. Plenty of good stuff for free. Also, it has tons of themes pre-installed. Check out the entire list of themes with screenshots on the GitHubrepository. Personally, I use Agnoster.

This is a plugin for zsh whose purpose is to bring fish shell-like syntax highlighting to the Z shell. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

fzf is a general-purpose command-line fuzzy finder. It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc. It's pretty powerful, but alternatively, you can try fzy that claims to be a "better fuzzy finder".

z is a zsh plugin that tracks your most used directories, based on frecency. After a short learning phase, z will take you to the most frecent directory that matches ALL of the regexes given on the command line, in order. For example, z foo bar would match /foo/bar but not /bar/foo.

Frecency is a portmanteau of 'recent' and 'frequency'. It is a weighted rank that depends on how often and how recently something occurred. As far as I know, Mozilla came up with the term.

Prezto is the configuration framework for zsh. It enriches the command line interface environment with sane defaults, aliases, functions, auto-completion, and prompt themes. It's an alternative to the famous Oh My Zsh.

Homebrew is a free and open-source software package management system that simplifies the installation of software on macOS operating system. Homebrew installs packages to their own directory and then symlinks their files into /usr/local. Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.

Cakebrew is the most convenient way to use Homebrew for your daily tasks. It does for Homebrew what Synaptic does to Linux package managers. It adds a user interface that can search for formulae, install, uninstall and upgrade formulae, tap and untap repos, update Homebrew and run the brew cleanup tool. You can also use this website to search and discover new formulas.

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on macOS.

The Fink project wants to bring the full world of Unix Open Source software to Darwin and macOS. We modify Unix software so that it compiles and runs on macOS ("port" it) and make it available for download as a coherent distribution. Fink uses Debian tools like dpkg and apt-get to provide powerful binary package management. You can choose whether you want to download precompiled binary packages or build everything from source.

Mas CLI is a simple command line interface for the Mac App Store. Designed for scripting and automation.

I don't use all these tools: for example, I only use Homebrew and don't have MacPorts and Fink installed on my computer. I also don't use Prezto since I personally prefer Oh My Zsh. I've tested Cakebrew a while ago and it's a good piece of software but I have a preference for the command line so I don't use it anymore. So, that's all, here are all the tools I use to boost my productivity when I'm in the terminal (very often).