MacOS Basic Navigation and Shortcuts
Knowing keyboard and screen shortcuts (a.k.a "hotkeys") will drastically improve your productivity and awesomeness. For a more exhaustive resource visit this site.
Keyboard Shortcuts
Whether you use VS Code, Atom, or otherwise, this list of common keyboard shortcuts will help you write code faster and smarter:
Quick Navigation
⌘+↓: Move cursor to the bottom of file⌘+↑: Move cursor to the top of file⌘+←: Move cursor to the beginning of current line⌘+→: Move cursor to the end of current line⌥(Option) +←: Move cursor to beginning of current word⌥(Option) +→: Move cursor to end of current word
Quick Selection
⇧(Shift) + Any of the Quick Navigation commands: Select all text from current location to where the cursor lands⌘+a: Select all textdouble-click: Select current wordtriple-click: Select current line
(Hint: Instead of Lasso-ing with your mouse/trackpad, just click on where you want to start your selection and hold ⇧(Shift) while clicking on where you want to end the selection. No more awkward finger dancing on your trackpad!)
Easy Text Transferring
⌘+c: Copy current selection to clipboard⌘+x: Cut current selection (Hint: cuts entire line if nothing selected, even blank lines)⌘+v: Paste from clipboard⌥(Option) +↑: Switch current line/selection with line above⌥(Option) +↓: Switch current line/selection with line below⇧(Shift) +⌥(Option) +↓: Copy current line/selection to line directly below⇧(Shift) +⌥(Option) +↑: Copy current line/selection to line directly above
Mac Window/Display Shortcuts
It's common to have a lot of tabs, programs, and desktops open. Instead of taking your hands off the keyboard every time you want to switch to a new view try this:
Tab Cycling
⌥(Option) +⌘+ (←or→): Toggle between each open tab (Works in both browsers and editors)
Application Cycling
⌘+⇥(Tab): Displays all open applications.- Continue holding
⌘while tapping⇥(Tab) to toggle through applications. - Hold
⇧(Shift) to toggle backwards. - Release all to select.
⌘+ Space: Opens up the Spotlight Search
Desktop Cycling
⌃(Ctrl) +↑(alsothree-finger-swipe-up): Displays all windows in current desktop.- Continue holding
⌃(Ctrl) and tap←or→to toggle between available desktops. You can alsothree-finger-swipe-leftorthree-finger-swipe-right. - Drag and drop windows to new or existing desktops at the top of the screen.
⌃(Ctrl) +↓(alsothree-finger-swipe-down) to select desktop.
Conclusion
A lot of these commands can be used in tandem with others to create earth-shattering efficiencies in the coding process. Practice messing around with these until they become habit. People will stand in awe at your greatness.