I’m a huge fan of the oh-my-zsh plugin manager for zsh and I can’t say enough good things about it, but I’ll come back to that.
In the meantime, let’s talk about all my must-have plugins.
plugins=( aliases autojump brew colored-man-pages copybuffer copyfile docker docker-compose dirhistory git git-extra-commands golang kubectl macos ripgrep sudo vscode zsh-autosuggestions )
I don’t actually remember where I learned about this one, but it’s a real-time cheat sheet for, you guessed it, your aliases. You give it a search string and it’ll tell you the alises for it and where they came from.
acs <search term>
$ acs merge [_default] mergepdf = gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.pdf [git] gbda = git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch -d 2>/dev/null gbnm = git branch --no-merged gm = git merge gma = git merge --abort gmom = git merge origin/$(git_main_branch) gmtl = git mergetool --no-prompt gmtlvim = git mergetool --no-prompt --tool=vimdiff gmum = git merge upstream/$(git_main_branch)
This is CD with a memory. You visit a path way down in some monorepo, and to get
back to it it’s just
j <directory name portion>.
I’ve written about this one before.
Don’t memorize all the options and subcommands for
brew, just use this and
bubu which expands to:
brew update && brew outdated && brew upgrade && brew cleanup
Pro tip: You won’t be able to use your machine for a bit while it’s doing that.
Colored Man Pages
I mean, they’re colored man pages.
This one’s a lot of fun. After you have a command typed out, use Ctrl+O to copy it. This is great for documentation and just handing off complicated commands to someone else.
cat filename | pbcopy because you don’t have to worry about the
control characters getting lost in the mix.
Docker & Docker Compose
Just aliases for these. Nothing to see here.
Some surprisingly useful ones here for interacting with the Finder at minimum.
| :------------ | :------------------------------------------------------- | | `tab` | Open the current directory in a new tab | | `split_tab` | Split the current terminal tab horizontally | | `vsplit_tab` | Split the current terminal tab vertically | | `ofd` | Open the current directory in a Finder window | | `pfd` | Return the path of the frontmost Finder window | | `pfs` | Return the current Finder selection | | `cdf` | `cd` to the current Finder directory | | `pushdf` | `pushd` to the current Finder directory | | `pxd` | Return the current Xcode project directory | | `cdx` | `cd` to the current Xcode project directory | | `quick-look` | Quick-Look a specified file | | `man-preview` | Open a specified man page in Preview app | | `showfiles` | Show hidden files in Finder | | `hidefiles` | Hide the hidden files in Finder | | `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on | | `music` | Control Apple Music. Use `music -h` for usage details | | `spotify` | Control Spotify and search by artist, album, track… | | `rmdsstore` | Remove .DS_Store files recursively in a directory | | `btrestart` | Restart the Bluetooth daemon | | `freespace` | Erases purgeable disk space with 0s on the selected disk |
I didn’t use this for the longest time and then I read about it on a blog. The
one I use most often is
vsc which starts a fresh instance in the directory
I’m in. I had previously aliased it to
c. which just confused people who
would watch screencasts of my work. I’d rather not confuse people.