Terminal is one of my most used apps throughout the day. I wanted to customize it so that it would best fit into my workflow and decrease the amount of time that I had to spend on the command line. This is a quick setup guide on how I did that.
This is the first window I see when I open my terminal:
And when I’m working on a project:
Coming from Hyper.js, I recently made the switch to the more robust iTerm and couldn’t be happier. iTerm’s configurability makes it a really easy to fine-tune your workflow and offers a lot more functionality than Hyper. Also, being a native app rather than an Electron app, the speed differences are much more noticeable.
I use the theme Dracula, which is a colorful but not overwhelming theme. It makes it easy for me to differentiate some of the different things I’m reading when using it, and its wide availability for many different applications keep a consistent theme for the different apps on my computer.
Because of my shell prompt having the git icons, the font must support programming ligatures, which are typically referred to as “powerline” fonts. I typically switch between SF Mono Powerline and Fira Code. Both of them are clean and easy to read and fit in well with my terminal.
iTerm has this really neat feature called the status bar. It’s a floating information bar above your terminal which keeps always displays some information. Its unobtrusive, and the color scheme makes the terminal even more beautiful.
Natural Text Editing
Out of the box, iTerm can be a little more restrictive in how you’re able to interact with text in the prompt. However, a quick change in the profile section of the settings allows you to interact with the command prompt as naturally as you would with any other application on your computer, using your standard jump-to short cuts. All you have to do is enable the natural text editing preset.
This is my favorite shell to use, and I pair it with the Oh My Zsh framework to manage zsh. One of my favorite things about Oh My Zsh is the shortcuts for the commands I run every day. For example, instead of
git commit -m you can run
gcmsg. There’s a full list of these shortcuts in this cheatsheet. I greatly appreciate these shortcuts, especially considering that I use them hundreds of times a day, which saves me a lot of typing.
Zsh Theme + Plugins
My Zsh prompt of choice is Spaceship, which I find to be a lot cleaner and nicer to use than the popular Agnoster theme. Agnoster uses large blocks of color on the screen, which looks less refined than the text-based prompt that Spaceship uses.
One of the first plugins I installed was zsh-syntax-highlighting, which adds syntax highlighting while typing out your command. This way, its quick to tell if a certain command is available, or if you’ve made a typo.
zsh-autosuggestions is a plugin which will use previously used commands to predict the next command. Of course, this is non-intrusive, and you have to press the right arrow if you want to fill in what was predicted. It’s a nice plugin to have when you’re repeating a lot of the same commands over again to test something and you don’t want to type out the entire thing.
I use the ‘->’ key to fill the autocomplete without execution, and
Space for fill and execution. You can change the setting using
bindkey in terminal, like so:
bindkey '^ ' autosuggest-execute
One of the most useful things that I use in my terminal is the ability to alias commands, so that I can type much shorter commands. They’ve made my life a lot easier for a couple of reasons.
The first is being able to jump from project to project in a single command, by aliasing a
cd command to the absolute path. For example, for any of my classes, I alias
440 for my CS 440 class, or
ymca for my Hack4Impact project to go directly into that directory. That way, no matter where I am, I will go straight to that directory.
Another thing that I use a lot is
open . to open in Finder, and
code . to open in VSCode. These are small things that make my development process a lot faster when switching between projects.