Top 5 tips to increase productivity in Terminal

the Pragmatic Dev
3 min readJan 22, 2020

--

How to use shortcuts to increase your productivity in Terminal

Photo by Andrew Neel on Unsplash

If you are new to the line of software engineering and you spend a lot of time on the terminal even if you don’t like it, here are 5 tips and tricks to make your life a little easier. (These tips and tricks are tested on Mac and keys are according to Mac).

1. Use iTerm2

iTerm comes with a variety of features which makes your life a little easier, it supports 256 colours, which is really helpful in syntax highlighting when you are using vim. It also supports splits panes which is one of the most productive tool you have at your disposal.

Split Panes in iTerm

To split a pane vertically press Cmd + d and split a pane horizontally usingCmd + shift + d and you’ll have multiple panes on the same tab. You can navigate between the panes using Cmd + [ and Cmd + ] . This save a lot of time compared to switching tabs.

2. Fast Navigation

One of the biggest problems we face on the terminal is changing a small part in the previous command, either we copy the command to a text editor and make the changes or we hold on to the arrow keys. We have better shortcuts to make our life easier.

Ctrl + a: Move to the beginning of the command.
Ctrl + e: Move to the end of the command.
Ctrl + u: Delete everything to the right of the cursor.
Ctrl + w: Delete a word to the left.
Ctrl + d: Delete a Character to the right.
Cmd + w: Closing a Tab
Cmd + t: Opening a new Tab
The following shortcuts doesn't come preloaded, you need to configure them from here:option + ←: Move one word to the left
option + →: Move one word to the right.

3. Using Profiles in iTerm

Profile is one the strongest part of the iTerm, it lets you do a lot of things, from opening and running you local server in a particular folder to to remotely accessing a web server just on a shortcut.

Profile setup in iTerm

You can select a keyboard shortcut, command to run when it boots up, and the working directory to be in when you switch to this profile. I use it to start my local development server. I press the shortcut Ctrl + Cmd + A, after I launch iTerm and It takes me to my working directory runs the command I supplied.

Another thing I use it for is different environments, like staging or prod and it ssh’s me into the server.

4. Using oh-my-zsh

ohmyzsh provides you with a lot of functionality that you don’t even realise you use. It has many benefits over the regular bash app that is your default terminal shell. It has the following features that breaks bash apart:-

  • Git integration.
  • case insensitive tab completion.
  • predefined aliases like gs => git status.

You can install the ohmyzsh from here.

Conclusion

These are the 4 tips, tricks and tools I use on my everyday tasks to make my life easier and efficient. Please share your tips, tricks and ideas, if you have something that you use on a daily basis.

--

--