DEV Community

Cover image for Keyboard Shortcuts To Make Life Easier(For Mac).
Neil Shapiro
Neil Shapiro

Posted on

Keyboard Shortcuts To Make Life Easier(For Mac).

When starting your journey to becoming a master at developing code one of the most arduous parts of creating code is the time spent typing or highlighting. The painstaking process of going back to find the one line you made an error or highlighting and right-clicking to copy and paste just adds countless minutes to an already lengthy process. To make life easier we can use keyboard shortcuts to edit/create in a more timely fashion. Although it is not necessary to use shortcuts, the time and energy you'll save will be worth it in the long run. What was once a 30-minute process for you could be cut in half. In this post, I will take you through some keyboard shortcuts to help you save time on your next coding endeavor.

-The Undo
This button will save you vast amounts of time. If you create a line of code that's typed out incorrectly this will undo anything you have just typed. Type command + z or ⌘ + z on your keyboard.

-Undo the Undo
If you're like me and make mistakes often you might command + z one too many times. In this instance Type command + shift + z or ⌘ + shift + z on your keyboard. To revert the changes.

-Select All
When it comes to highlighting multiple lines of code this one will save you a plethora of time. Hit command + A or
⌘ + shift + L. One of my favorite ways to use this command is if you have multiple lines of code you need to comment out for pusedo-coding. You can select all and then press /. Which will comment out everything you have highlighted

-Select All Matching Instances
Let's say for example you're trying to select the same matching variable in multiple lines of code, you should give this shortcut a try. command + shift + L or ⌘ + shift + L.

-Select Current Word
If you want to highlight one particular word instead of many. Depending on whether your cursor is to the right or left of the word you'd like to highlight, hit option left arrow or option right arrow to highlight that word.

-Delete code from a current position to the start of a line.

If you would like to delete a line of code starting from the beginning of the line and ending at your cursor hit option + delete

-Delete the whole line of code
If you're looking to delete the whole line of code simply hit control + k and the entire line will vanish.

These are my favorite shortcuts that I use with frequency. They have saved me copious amounts of time when developing code. Add these shortcuts to your coding arsenal and see how much time they save you.

Top comments (0)