Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 30, 2019 12:32 am GMT

Mac Keyboard Shortcuts Every Dev Should Know

Something that has always interested me is the impact that small actions have on our daily lives and I think knowing keyboard shortcuts is one of those actions. Why? It saves you time. Yes, only a tiny fraction of time but all those tiny fractions add up in the end. Keyboard shortcuts can also give off the impression that you are confident in what you are doing, which is a huge plus.

My Story with Keyboard Shortcuts

Before I started programming I had no idea how to use any keyboard shortcuts. It was through programming, and my insistent fianc, that I began to learn how to navigate around my computer while rarely touching my mouse/trackpad. He used to get so frustrated with me when I'd ask him a question while coding and I'd use the trackpad of my laptop to navigate through open windows or to select a word. Why would he get mad? Well, I was sort of wasting his time. Using keyboard shortcuts creates a quicker way to navigate your laptop/computer than constantly pulling back and using your trackpad/mouse.

Since gaining this skill I feel as if I have gained the tiniest semblance of confidence in my demeanor at work and during interviews. This skill has helped me combat the good 'ole fight with imposter syndrome, because it has given me a sense of "I know what I'm doing."

Anyways, that's enough about me. Let's dive on in.

Text Editor Based Keyboard Shortcuts

One thing I'll note before jumping into each shortcut is that these are Mac specific. If you are running on a different system just hop on your favorite search engine and look up what your equivalent is!

Undo

This is a need-to-know, especially for me who incorrectly types very often! If you ever need to undo any of the changes you've made to your code editor simply type command + Z.

Undo Your Undo

Wait! What if you accidentally got trigger happy and undid something you didn't mean to! Don't fret, command + shift + Z is here to save the day!

Wonder Woman appearing out of the destruction

Select Matching Instances

This is one of my favorite keyboard shortcuts because I am sometimes indecisive with my variable names and need to change them. Instead of going through and changing each instance where I called the variable, I select one instance of it and use command + D to select each time that variable appears one at a time.

The reason I like using this one over the one I'm covering next is because sometimes the phrase being matched appears within the name of another variable and I may be happy with that variable! No need to change it!

Select ALL Matching Instances

If you feel confident and comfortable to select all instances that match the phrase you've selected at one time, then give command + shift + L a try.

Undoing the Selects

If you've accidentally selected an instance of the phrase that you didn't mean to select, then use command + U to undo it. Note that if you do it after using command + shift + L it will unselect everything, not just one at a time.

Go to Beginning of Line

If you are ever in the middle of a line (or even the end) and want to jump to the beginning of the line use command + left arrow or control + A instead of holding down the left arrow until you reach the start.

Go to End of Line

To get to the end of the line you can either use command + right arrow or control + E.

Select All Code From Current Position to Beginning of Line

Similar to jumping to the beginning of the line, in order to select the code from your cursor's current position to the beginning of the line you should use command + shift + left arrow or control + shift + A.

Select All Code From Current Position to End of Line

You may have already guessed that there is also a shortcut to select code from your cursor's current position to the end of the line! In order to do this use command + shift + right arrow or control + shift + E.

Select All Code

Any time you want to select all the text in one file use command + A.

Select Current Word

So now you may be wondering if there is a shortcut to select the word your cursor is currently near. Well there is! If your cursor is left of the word you want to select use option + shift + right arrow. Now if your cursor is to the right of the word you would use option + shift + left arrow.

You can continue to select more than word if you keep clicking the arrow in the desired direction.

Go to Start / End of a Word

If you want to move around within a line without jumping straight to the beginning or end of the line there is a shortcut that allows you to move one word at a time. This is option + left arrow or option + right arrow, which one you choose is dependent upon which direction you'd like to move in.

Delete Code From Current Position to Beginning of Line

When you have dead code that you no longer need and it requires you to remove everything from your cursor's current position to the beginning of the line you can use option + delete.

Delete Code From Current Position to End of Line

In order to delete the code from your current position to the end of the line use control + K.

General Computer / Browser Keyboard Shortcuts

Quit Current Application

If you want to quit an application, which will close all open windows of said application, use command + Q.

Close Current Window

When you are ready to close the current window you are in (like I will be when I'm finished writing this blog post ) you can use command + W.

Minimize Current Window

If you don't want to close the window but want it off the screen, then you should minimize it by using command + M.

Minimize All Windows of an Application

We can go even further by minimizing all windows that belong to a particular application by using the shortcut command + option + M.

Open New Window

In order to open a new window of an application use the shortcut command + N

Open New Tab

If you ever want to open a new tab while you are in your browser use command + T.

Open Last Closed Tab

When you accidentally close a tab you didn't mean to close, you can use command + shift + T to get it back!

Disney character saying "witchcraft"

Switch Between Tabs

Switching between tabs while in the browser has to be one of my favorite keyboard shortcuts because when I write blogs I often reference many articles. To go towards the left use command + shift + ] and to go to the right use command + shift + [.

Select Address Bar to Search

This is one of my favorite finds during my research for this blog! While in the browser you can use command + L to select the address bar so you can start typing in your next web destination!

Invoke Spotlight

Another general useful shortcut is command + space to invoke spotlight to search your machine.

Open Application Switcher

If you are ever working across multiple applications and need to switch frequently use command + tab. You keep pressing tab until you reach the application you want as your current window.

Open Current Application's Preferences

Another awesome find of my research!!

little girl REALLY excited about eating cotton candy

In any application use command + , to open up the applications preferences.

Final Thoughts

This was a fun blog post for me to research and write. I learned so many new shortcuts I never knew of and I even thought of a few I use very often while writing it.

If you are new and are thinking "Holy cow! How do I remember all these?" don't worry. I also felt overwhelmed when I first started. Like anything, with more repetition and practice it'll become secondhand nature to use them.

Thanks for reading and happy coding!

Note: The cover image for this post is brought to you from the Ballycotton Cliff Walk in Ballycotton, Ireland.

Sources

Mac Keyboard Shortcuts for Web Developers
24 keyboard shortcuts Mac users need to know


Original Link: https://dev.to/torianne02/mac-keyboard-shortcuts-every-new-dev-should-know-169l

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To