When lecturing, I'm commonly asked how I move so quickly between windows, between tabs and in applications like Terminal or the browser. In this post, I’d like to briefly highlight four essential tips and tricks for becoming a faster and more productive developer.
As an aside: these commands are Mac specific, but can easily be translated to another operating system!
1. Keyboard Navigation
This one may seem a bit silly, but it's invaluable to learn and these shortcuts work in almost every application! Try these out in your text editor or browser.
-
Hold
option
and press left or right – jump between words -
Hold
command
and press left or right – jump to beginning/end of line -
Hold
shift
and press left or right – select one character at at time -
Hold
option
andshift
and press left or right – select one word at at time -
Hold
command
andshift
and press left or right – select one line at at time -
Hold
option
and pressdelete
– delete a word -
Hold
command
and pressdelete
– delete a line
2. Navigate effectively in Terminal
As a developer, you're going to be spending quite a bit of time in Terminal, which means you have to become confident navigating without a GUI (graphical user interface) and a mouse!
One of the biggest struggles we see students deal with is trying to find folders that they have previous created. While using the find
command is great for files, there's a nice tool called fasd
(pronounced "fast") that allows you to find folders in seconds. You can read more about it here.
Here are some instructions for how to install it:
- Download the zip file
- Unzip the file
- In Terminal,
cd
into the unzipped file and runmake install
- In your
.zshrc
or.bashrc
(which are located in your home directory), add the followingeval "$(fasd --init auto)"
- Close Terminal and open it again
- You should be able to run the command
which z
without any errors - Once you visit a folder in terminal you can type
z
followed by the name of the folder and press tab and then enter to jump to the folder.
Aside from fasd
, there are some essential shortcuts you need to know when working in terminal, including:
-
control
+a
– jump to the beginning of a line -
control
+e
– jump to the end of a line -
control
+w
– delete one word -
control
+u
– delete an entire line -
option
+ left and right (works everywhere!) – jump between words
3. Know your Browser shortcuts (Chrome specific)
Along with the Terminal, your browser will be one of the most commonly used tools in your day-to-day. Here are a few shortcuts to make sure you know!
-
command
+l
– jump to the browser bar -
command
+t
– open a new tab -
command
+shift
+c
– open the elements tab with the selector picked -
command
+option
+j
– open the chrome console -
command
+shift
+d
– dock out the chrome console -
command
+w
– close the current tab -
command
+option
+ left or right – move between tabs
4. Get comfortable with your editor (VSCode specific)
At Rithm School, we tell all of our students to use VSCode for their text editor. Here are a few keyboard shortcuts for this editor specifically. If you don't use VSCode, that's okay – these shortcuts most likely exist in your editor, though the keyboard shortcuts may be slightly different!
-
highlight text, then press
command
+d
– highlight the next occurrence of that text in the current file -
highlight text, then press
command
+shift
+l
– highlight all occurrences of that text in the current file -
option
+shift
+ up or down – create a copy of the current line (above or below your current cursor position) -
option
+ up or down – move the current line up or down -
command
+p
– search through the current workspace by file name -
command
+shift
+f
– search through all text in the current workspace -
command
+b
– toggle sidebar -
command
+`
– toggle windows -
command
+option
+ left or right – move between tabs
Bonus! Get to the Terminal/Editor/Browser as soon as possible
Drag and drop a folder to the terminal, text editor, or if it's an HTML file even to the browser to open it up right away in that application.
In short, it's going to take some practice to get comfortable with all of these commands and shortcuts, but the more you can pick up the faster you'll get!
One final tip: if you want to master these shortcuts, don't try to do it all in one go. Focus on just one shortcut at a time, and practice it for a few days. Once you've mastered it, move on to the next one. It'll take more time, but this is the best way to make these shortcuts second nature.
Want to learn more? Check out our curriculum here or join us at a meetup soon!