Productive Terminal
@imarikchakma · Dec 29, 2023
I’ve been using Z-shell (Zsh), Oh My Zsh, and Iterm2 for a while now. It’s a great combination and I love it. I’ve been using it for a while now and I’ve customized it to my liking with a few plugins and themes.
Zsh is a powerful shell that operates as both an interactive shell and as a scripting language interpreter.
Plugins
I use the following plugins:
-
git aliases - It’s a collection of aliases for
git
commands. Instead of typinggit status
I can just typegst
and it’ll do the same thing. -
zsh-syntax-highlighting - Highlight commands while typing.
-
zsh-autosuggestions - Suggests commands as you type based on history and completions. Really handy when you’re trying to remember a command you used a while ago especially for
git
commands. -
z - jump around - Tracks your most used directories and allows you to jump to them quickly. I use this all the time to jump to my projects directory. Let’s say I wanna jump to one of my projects, I just type
z <project-name>
and it’ll jump to that directory.
You can install these plugins by following the instructions on their respective GitHub repositories.
Shortcuts
Here are some common shortcuts I use:
- ^ + R - Search through your command history.
- ⌘ + D - For splitting the terminal window horizontally (Iterm2).
- ⌘ + ⇧ + D - For splitting the terminal window vertically (Iterm2).
- ^ + A - Move cursor to the beginning of the line.
- ^ + E - Move cursor to the end of the line. directory.
- ^ + W - Delete the word before the cursor.
cd -
- Switch back and forth between the current and previous directory.repeat 5 echo "Hello World"
- Repeat a command 5 times. Useful when testing rate limiting on APIsrepeat 10 curl ...
.
For more shortcuts, you can use aliases
and functions
. I have a few of them in my .zshrc
file. You can check them out cat ~/.zshrc
.