Shortcuts and utilities
Overview
- Special key Names and Symbols
- Full Screen Finger Gymnastics
- Key visibility
- Keyboard Ergonomics
- Switch keys on macOS
- Caps Lock to Escape
- Voice Recognition
- Apple components from any active app
- Process Navigation
- Window navigation
- Microsoft vs. Mac Keyboards
- Trackpad Remapping Tool
- Keyboard Mapping
- App-specific keys
- Chrome Browser Tabs
- Text Editor Special Characters
- Keyboard Symbols
- Robot typists
- Cross machine
- Resources
- Bash-it
- Outlook
- Tmux
- Comprehensive
- More on OSX
This topic is about how you can do things faster by automating actions on the keyboard controlling your Mac, beyond Apple’s standard Keyboard Shortcuts at https://support.apple.com/en-us/HT201236
Special key Names and Symbols
The “Special” keys on a Mac’s keyboard are represented by both symbols and names, so memorize this:
Full Screen Finger Gymnastics
PROTIP: To evaluate Mac developers, some interviewers ask “show me how you enter and exit Full Screen”. This is because they assume that the most productive developers work with their hands always on the keyboard.
Windows has its F12 key. Apple has Mac users do the equivalent of a double Summersault with your fingers. How do you type, at the same time:
- control + command + F
PROTIP: To toggle Full Screen view using the default configuration from Apple: while keeping your left forefinger on the F “home” key, reach with your left thumb to hold down the control key. This may hurt at first (until you get used to it). Try raising your hand
Now, while keeping your right forefinger on the J “home” key, reach with your right thumb to hold down the command key on the right side of the Space Bar. Then you’re in position to press F with your left forefinger.
Key visibility
PROTIP: Some use keyboards (RGB) that light up keys in the dark. But I personally think the best strategy is to find a way to not have to look at the keyboard at all.
PROTIP: Some put tiny drops from a glue gun on strategic points on the keyboard so they can orient their finger in the dark without looking.
Now, while keeping your right forefinger on the J “home” key, reach with your right thumb to hold down the command key on the right side of the Space Bar. Then you’re in position to press F with your left forefinger. </ul>
This may be a generalization. But many top coders actually like the vi text editor because it doesn’t use difficult-to-reach keys or mouse that require the user to take their eyes off the screen. DevSecOps coders have no choice because some operating systems only offer only vi (such as during Kubernetes exams).
PROTIP: To evaluate Mac developers, some interviewers ask “show me how you enter and exit Full Screen”. This is because they assume that the most productive developers work with their hands always on the keyboard.
Keyboard Ergonomics
Resourceful coders make it so they don’t need to waste time and attention reaching for the mouse.
Although pricey at $340 from Amazon (perhaps the most expensive keyboard available), the “Advantage2” keyboard from Kinesis-ergo.com (at Bethel, Washington state) makes it easier and faster for your fingers to reach keys due to its unique contoured key wells. Its keys in the middle transfer more work to thumbs than conventional square keyboards.
A Ergonomics shop TheHumanSolution.com note the slant of keys enables natural (rather than bent) wrist placement that prevents repetitive motion injury causing career-ending pain in wrists and shoulders.
However, the keyboard does take some “learning time” as its keys are in a different location than on conventional keyboards. The manufacturer has a 7 day return and 3 year warranty policy.
Desiring quieter operation, I chose Cherry 45g MX Red (quiet linear-force, not “clicky”) mechanical key switches (instead of Brown keys which provide tactile feedback on each keypress). Cherry Red key switches are also used in the iKDC KD104 MX silent keyboards.
But I don’t think the Red keys arenot much quieter than other keyboards. (Razor Opto-mechanical Red or Ornata v2 membrane keyboards seem the quietest to me. They are also have short 1mm travel to activate and quickest debounce delay).
Further quiet may be achieved by lubrication or replacing key switches with rubbery Zilent keys.
(I don’t know how the keyboard responds to “rollover” of several keys almost simultaneously, which other keyboards call “anti-ghosting”).
For even faster operation, use the keyboard’s 2MB of memory on-board to store SmartSet Programming Engine macros.
Videos:
- https://www.youtube.com/watch?v=8WwuusfB0QA Aug 20, 2016 is the most detailed
- https://www.youtube.com/watch?v=ILItPWuirAk
- https://www.youtube.com/watch?v=PhQlZvUzT7w Aug 3, 2016 from Kinesis
Foot pedels
The Kinesis Advantage keyboard has a phone plug to connect to a foot peddle to press the “Enter” key.
Switch keys on macOS
Caps Lock unintended
BLAH: It’s annoying when all of a sudden everything I type is in caps. That happens because I accidentally had my hand too far to the left when I intended to press the A key.
I can type all caps by holding down the shift key with my left or right hand.
We can kill 2 keys at once.
Caps Lock to Escape
BLAH: The Esc (Escape) key is too far North on the keyboard and forces some to look down on the keyboard. And the Caps Lock key is too close to keys, causing problems with accidental password entry and lockouts.
PROTIP: Make the caps lock key work like the Esc key:
- Press the Apple icon and select System Preferences.
- Type K. Cursor down to highlight Keyboard. Press space bar to open it.
-
Click “Modifier Keys” at the lower-right corner.
-
Click the entry for “Caps Lock (⇪) Key:” and select “⎋ Escape”.
Swap command and control as well
PROTIP: Some switch the control and command keys on the left side so that they can get to all such keys using thumbs. This would also allow you to press two keys at once by pressing between the keys, thus able to perform most combinations using your hands.
- Click the entry for “Control (^) Key:” and select “⌘ Command”.
-
Click the entry for “Command (⌘) Key:” and select “^ Control”.
- Click OK.
-
Press control+Q or click the red x to dismiss the System Preferences dialog.
Alternately, the above actions can be done using a Python script or by downloading the free Karabiner which works on OSX Sierra since Apple remapped key commands. It’s free but note the package has many lingering issues.
Voice Recognition
PROTIP: Those who don’t have people sitting nearby can enable voice recognition to automatically type some (not all) keys. This has been available since the OSX Yosemite version.
https://support.apple.com/en-us/HT203085
See this video:
-
CAUTION: Enabling “Use Enhanced Dictation” (In Apple System Preferences > Dictation & Speech > Turn on Dictation) causes an approximately 800MB file to be downloaded to your Mac.
- Choose Accessibility. Scroll to Dictation. Scroll to see which commands.
- Check Enable Advanced Commands. Scroll to see which commands.
- Get into Automator.
Apple components from any active app
Purpose | Name | Mouse | Hot corner | Key | Hide |
---|---|---|---|---|---|
Active apps thumbnails | Mission Control (formerly Expose) | 3 finger swipe up | - | control + up fn + F3 | Esc |
Active apps dashboard | Application Windows | - | Upper left | control + F3 | Esc |
- | Desktop | Thumb and 3 finger spread | - | F11 | toggle |
Calculator, other Accessories | Dashboard | 3 finger swipe right | Lower left | ? | - |
Apps icons customized | Dock bar (bottom of screen) | Mouse beyond bottom of screen | - | - | Esc |
Active app selection | Active apps | - | - | ⌘ + Tab Repeat | - |
Installed apps | Launchpad | Thumb and 3 finger pinch | Upper right | fn + F4 | - |
Files and folders | Finder | - | - | ⌘ + option + T | - |
Put display to sleep | Start screen saver | - | Lower right | control + Shift + Power button | - |
omni-search | Spotlight | - | - | command + spacebar | Esc |
mute | Speaker volume | - | - | fn + F11 | - |
Softer | - | - | fn + F12 | - | |
Louder | - | - | fn + F12 | - | |
Alerts | Notification Center | - | - | - | - |
[1] = PROTIP: This command does not work when the active program is in an extended screen.
Awkward Keys
There are some key combinations that are so awkard to use that it’s faster and easier to use a mouse or trackpad.
Since the fn and control keys are only on the left side of a MacBook keyboard, using them requires a Carpel-tunnel Syndrome-inducing move of the left hand:
- control+F2 to highlight the Apple menu.
- control+F3 to highlight the Dock at the bottom of the screen.
On a Mac without a visible Function keys, press fn to reveal them, thus:
- fn + control + F2 to highlight the Apple menu.
- fn + control + F3 to highlight the Dock at the bottom of the screen.
PROTIP: The fn key is easy to find without looking because it’s at a corner. But use a companion key on the right side of the keyboard.
Process Navigation
Press command + Tab to cycle through programs running.
Press shift plus the above reverses the cycling direction.
Stop on the icon of the app you want to make active.
Window navigation
Purpose | Menu | Mouse | Key |
---|---|---|---|
New window | File | New Window | - | ⌘ + N |
New window Incongnito | - | ⌘ + shift + N | |
Cycle through windows in app | Window | - | ⌘ + ` (at upper left corner of keyboard) |
Maximize window (no menu bar) | - | Click green icon at the top left corner of window | ⌘ + shift + F toggle |
Un-Maximize window | - | Cursor to top left corner. Click on green icon. | |
Minimize window | - | Click yellow ball. | ⌘ + M |
Close current window | - | Click red ball. | ⌘ + shift + W |
Close all windows | - | - | ⌘ + option + W |
Preferences | app name | Preferences | - | ⌘ + , |
Quit app completely | app name | Quit | - | ⌘ + Q |
Microsoft vs. Mac Keyboards
Needing to change habits learned typing is difficult and takes time. It’s literally taking physical therapy. This is perhaps the most frustrating aspect of changing from Windows to a Mac.
Here are the most problematic among Keyboard mappings using a PC keyboard on a Macintosh on Microsoft’s website:*
Microsoft Windows | Apple Macintosh | issue |
---|---|---|
Right-click (Alt) | Holding down control during mouse click | - |
Ctrl + mouse click multiple items | control + option + mouse click | Two keys on Mac |
Delete (right of cursor) | fn + delete control + D | swapped |
Backspace (left of cursor) | delete control + H | |
Function key | fn + F1 ... F12 | |
Windows Start orb | control+F2, then enter/return | awkard |
Num lock | Virtual Machine > Send Key | |
Home (top of doc) | fn + left | |
End (bottom of doc) | fn + right | |
Insert toggle | Requires mapping |
Delete and Backspace keys swapped
The Delete key on an Apple keyboard (⌫ on older keyboards) is actually the backspace key to all other operating systems. To press the equivalent of the Windows backspace that removes to the left of the cursor:
- On a Macintosh notebook keyboard, press fn + Delete.
- On older full-sized Macintosh keyboards, press ⌦ (called "Forward Delete") below the Help key.
The ALT key on Windows is OPTION on Mac keyboards.
To send key commands from a Mac into a Windows instance inside VMWare Fusion.
Insert key requires mapping
Sending the equivalent of Windows keyboard Insert on a Mac is problematic, especially within a virtual Windows machine.
- On older Macintosh keyboards, press the Help key.
- On older Macintosh notebook keyboards, press fn+M.
- Newer Macintosh notebooks do not support fn+M. So map Alt+F1 within VMware Fusion > Preferences > Keyboard & Mouse > Key Mappings.
Trackpad Remapping Tool
The trackpad on OSX recognizes multiple touch points (fingers) at once.
- One finger to move the mouse cursor.
- Two fingers to scroll up or down.
- Three fingers to move among applications active.
BetterTouchTool (BTT) $6.50 app remaps what Apple input devices (keyboard, Magic Mouse, Touchpad, Trackpad) recognize, and also adds more gestures.
Use my installer for Mac to setup this program along with all others by running repeatable Ansible declarations.
There are several dimensions:
Fingers | Motion | Direction | Repeats | Pressure |
---|---|---|---|---|
1 2 3 4 | tap swipe pinch in/out (zoom) | up down left right | tap TipTap | light medium heavy |
Combos: single finger tap left, single finger tap right, single finger tap, two finger tap, two finger click, two finger swipe (up/down/left/right), three finger tap, three finger click, three finger swipe (up/down/left/right) and ‘TipTap’ left/right.
- https://www.youtube.com/watch?v=A1xFhreDR_k
- https://www.youtube.com/watch?v=7mr2IiJ0Y0E
- https://www.youtube.com/watch?v=qeocxFO5yWA
- https://www.youtube.com/watch?v=aFmB3XCva_Y
Programs can be invoked several different ways:
- Click the magnifying glass and type the program name
- Click on the apple menu
- the Dock
- or from the Applications folder on your hard drive.
To reset during open, in the Application folder, hold down all keys SHIFT OPTION COMMAND then click the app’s icon.
Keyboard Mapping
NOTE: MacOS defines most of its keybindings for editing text in:
- /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict
PROTIP: Remap home and end key by creating folder ~/Library/KeyBindings/ and in it file DefaultKeyBinding.dict containing a property list like this:
{ "\UF729" = moveToBeginningOfLine:; // home "\UF72B" = moveToEndOfLine:; // end "$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home "$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end }
This change requires a reboot.
App-specific keys
Finder
I probably click the Finder Favorites more than anything else. So I’ve memorized the keyboard keys.
-
Option + ⌘ + L for the Downloads folder
- Shift + ⌘ + D for the Desktop folder where screen captures are stored (by default).
- Shift + ⌘ + A for the Applications folder where apps are stored.
This enables me to remove default items in the Favorites list (by right-clicking on it) so I can instead list my own folders I use most often.
-
To go a level up or down in the Finder, press ⌘ + up arrow or down arrow.
-
Open parent folder and close current window: Option-Command-Up Arrow
-
To open folders and files by clicking on it and pressing ⌘ + O (instead of Enter as you would on Windows).
- ⌘ + 1 = Icon view
- ⌘ + 2 = List view
- ⌘ + 3 = Column view
-
⌘ + 4 = Cover flow view
QUESTION: Is there a key to expand width of columns?
-
control + ⌘ + number to control Arrange sorting.
- ⌘ + F to Search text.
Hide and Unhide Folders
Under Favorites, click on your user name (next to the house icon). If the Library folder does not appear:
sudo chflags nohidden /Library/ ~/Library/
To hide Library again:
sudo chflags hidden /Library/ ~/Library/
System Preferences keyboard shortcut
Apple’s System Preferences is a dialog I go to often. But it doesn’t have a default universal keyboard shortcut.
So let’s make one, using control+command+comma. (I use my middle finger to reach the comma).
-
Click the Apple icon. Notice whether there is a shortcut for System Preferences. Below is what it looks like after going through the steps below.
- Select System Preferences.
- Click the Keyboard panel.
- Click “Shortcuts” tab.
- Select “Application Shortcuts” from the list.
- Click the [+] plus button for the pulldown menu.
- Choose “All Applications”, then in the field labeled “Menu Title” enter “System Preferences…”.
- Click in the field labeled “Keyboard Shortcut”.
- Press the hotkey you want to use. For me use Control+Command+,. You should see the icons appear.
- Click “Add” to close out of System Preferences.
- Exit System Preferences by clicking the red dot.
- Try it: Hit the shortcut you just created.
Chrome Browser Tabs
Purpose | Firefox | Chrome |
---|---|---|
New blank tab | ⌘ + shift + H | |
Home tab | ⌘ + T | |
Open Settings / Preferences tab | ⌘ + , (comma) | |
Close current tab | ⌘ + W | |
Re-open tab | ⌘ + shift + T | |
Cycle through tabs | control + Tab | |
Bookmarks manager tab | - | option + ⌘ + B |
History tab | - | option + ⌘ + H |
Downloads tab | - | shift + ⌘ + J |
Browser Console | shift + ⌘ + B |
See https://support.google.com/chrome/answer/165450?hl=en
- Firefox keyboard shortcuts can be re-mapped using the Manu Wizard plug-in.
Page operations within Chrome Tab
Purpose | Mouse | Key |
---|---|---|
History | - | shift + ⌘ + H |
Search web | - | option + ⌘ + F |
Find bar (to text on page) | - | ⌘ + F |
Find next match | - | ⌘ + G |
Find previous match | - | shift + ⌘ + G or shift + Enter |
Enter highlighted text to Find | - | ⌘ + E |
Page Down | - | fn + down arrow |
Page Up | - | fn + up arrow |
Page top (home) | - | fn + left arrow |
End of page | - | fn + right arrow |
Previous page | - | ⌘ + [ |
Next page | - | ⌘ + ] |
Refresh | - | ⌘ + R |
Bookmark current page | - | ⌘ + D |
JavaScript Console | - | option + ⌘ + J |
Source HTML | - | option + ⌘ + U |
Text string operations
Purpose | Mouse | Key |
---|---|---|
Cut highlighted text | - | ⌘ + X |
Copy highlighted text to clipboard | - | ⌘ + C |
Paste highlighted text from clipboard | - | ⌘ + V |
Copy URL of current page to the clipboard. | - | option + ⌘ + C |
Paste content without formatting | - | shift + option + ⌘ + V |
Chrome iMacros
To use macros, add to Chrome browser the iMacros for Chrome.
This auto-opens http://imacros.net/browser/cr/welcome.
To use macros on Firefox, open in Firefox iMacros for Firefox. Click Add to Firefox. Click Install. Click Restart Now.
Microsoft Word for Mac 2011
-
- Save = command + S
- Save As = Shift + command + S
Text Editor Special Characters
In a text editor, press either Shift + Option + 8 or Option + 0.
For autocomplete in TextEdit, press Tab + Esc. Unfortunately, this is the same key to toggle the Mac’s text-to-speech.
For the ©Copyright symbol, press the “alt” key (or “option”) and hold it down while typing “g” on the keyboard.
Keyboard Symbols
This website and others make use of special coding to represent Apple icons and keyboard icons.
Below is modified from Joe Weaks
Icon | Name | Unicode | Font |
---|---|---|---|
⌽ | Power 3 | U+233D | |
| Apple symbol 1 | U+F8FF | Lucida Grande |
⌘ | Command (Open Apple) 2 | U+2318 | |
⌃ | Control | U+2303 | |
⌥ | Option (Alt, Alternative) | U+2325 | |
⇧ | Shift | U+21E7 | Apple Symbols |
⇪ | Capslock | U+21EA | |
⎋ | Escape | U+238B | |
⇥ | Tab forward | U+21E5 | |
⇤ | Tab back | U+21E4 | |
␣ | Space | U+2423 | |
⏎ ↩ | Return | U+23CE U+21A9 | |
⌫ | Delete back | U+232B | |
⌦ | Delete forward | U+2326 | |
﹖ ⃝ | Help | U+003F & U+20DD | |
⇱ ↖ ↸ | Home | U+21F1 U+2196 U+21B8 | |
⇲ ↘ | End | U+21F2 U+2198 | |
⇞ | Pageup | U+21DE | |
⇟ | Pagedown | U+21DF | |
↑ ⇡ | Up arrow | U+2191 U+21E1 | |
↓ ⇣ | Down arrow | U+2193 U+21E3 | |
← ⇠ | Left arrow | U+2190 U+21E0 | |
→ ⇢ | Right arrow | U+2192 U+21E2 | |
⌧ | Clear | U+2327 | |
⇭ | Numberlock | U+21ED | Apple Symbols |
⌤ | Enter | U+2324 | |
⏏ | Eject | U+23CF |
Robot typists
For making videos:
https://github.com/pofallon/sublime-phantypist
Slowly output the contents of the clipboard into the currently active tab,
one character at a time. Map to CTRL-SHIFT-V for a slow paste command.
https://github.com/aholub/type
Applescript “robot” typist inserts characters into XCode or other application
https://gist.github.com/xaviershay/6656216
Creates a mapping that will type out the given text into vim.
Cross machine
For a $19 one-time purchase,
https://symless.com/synergy
enables you to use a single keyboard and mouse on Mac, Windows, and Linux.
Resources
Instead of the built-in command+Tab to switch among active programs, follow Daniel Szpisjak’s How to become a modern magician? - productivity tips for devs on macOS describes setup and use of Hammerspoon Lua language which uses a complex combination such as Shift+Control+Option to be a “Hyper” key such as the CapsLock. Karabiner+Elements
Assign Hyper+X to a specific program, and the pop-up shown by command+Tab will not come up.
Bash-it
https://github.com/Bash-it/bash-it community Bash framework of autocompletion, themes, aliases, custom functions based on https://github.com/robbyrussell/oh-my-zsh
Outlook
Among the Keyboard Shortcuts for Outlook on macOS:
Minimize or expand the ribbon = Options + COMMAND + R
Hide the reading pane or show it on the right = COMMAND + Backslash ()
Hide the reading pane or show it below = Shift+ COMMAND + Backslash ()
Tmux
Tmux is a contraction of “Terminal Multiplexer”.
Comprehensive
Tyler.io show the keys he defined using Magnet (https://magnet.crowdcafe.com/) and KeyboardMaestro (https://www.keyboardmaestro.com/main/). Tyler Hall’s code is at https://github.com/tylerhall/
More on OSX
This is one of a series on Mac OSX:
- MacOS Hardware and accessories
- MacOS Boot-up
- MacOS Terminal Tips and Tricks
- MacOS Find (files and text in files)
- MacOS Keyboard tricks
- MacOS Setup automation
- MacOS Homebrew installers
- Printing from macOS or Linux
- Manage Disk Space on MacOS
- Data Backups on MacOS
- Ports open
- Applications on MacOS
- Windows on Apple MacOS
- Packer create Vagrant Windows image
- Python on MacOS
- Maven on MacOS
- Ruby on MacOS
- Java on MacOS
- Node on MacOS installation
- PHP on MacOS
- Scala ecosystem