Development Tools
VS Code Integration
Install the code CLI by opening the Command Palette and selecting Shell Command: Install 'code' command in PATH. Once available, launch files or directories directly from a shell session.
Integrated terminal bindings:
- Toggle visibility:
Ctrl + ` - Spawn new instance:
Ctrl + Shift + ``
Editor navigation:
- Jump to previous cursor position:
Ctrl + - - Jump to next cursor position:
Shift + Ctrl + -
Adjust the embedded terminal font size via settings.json if the default is unreadable.
Terminal Aliases and Configuration
For persistent shortcuts across sessions, define aliases inside ~/.zshrc:
alias py310="/opt/homebrew/bin/python3.10"
alias node-lts="/usr/local/bin/node"
alias ll="ls -lah"
Session-only aliases disappear after the window closes.
Terminal Cursor and Line Editing
- Move to start of line:
Ctrl + A - Move to end of line:
Ctrl + E - Clear entire line:
Ctrl + U - Clear to end of line:
Ctrl + K - Search command history:
Ctrl + R - Clear screen:
Ctrl + L - Word-level movement:
Option + Left/Right
Handling Spaces in Paths
Avoid manual escaping by wrapping paths in quotes:
cd "/Users/dev/My Projects"
open "/Users/dev/My Files/report.txt"
Core Keyboard Shortcuts
Text and File Operations
- Forward Delete:
Fn + Delete - Cut / Copy / Paste:
Command + X,Command + C,Command + V - Moving files: macOS does not support cut in Finder. Copy with
Command + C, then move withCommand + Option + V. - Select multiple items:
Command + Clickfor disjoint selection,Shift + Clickfor contiguous ranges. - Copy file path as text:
Option + Command + C - Toggle hidden files:
Shift + Command + . - Home / End in text editors:
Fn + Left Arrow/Fn + Right Arrow
Navigation and System
- Switch applications:
Command + Tab - Open Spotlight:
Command + Space - Lock screen immediately:
Control + Command + Q - Launchpad: four-finger pinch inward on the trackpad; dismiss with an outward pinch.
- Show Desktop: four-finger outward spread (when Launchpad is not active).
- Mission Control: three-finger swipe up; swipe down to exit.
- Right-click: two-finger tap on the trackpad.
- Smart zoom: double-tap with two fingers.
- Screenshot and screen recording utility:
Command + Shift + 5 - Force quit an app:
Option + Command + Escape - Close window/instance:
Command + W - Quit application/process:
Command + Q
Window and Display Management
Split View and Virtual Desktops
- Enter Split View by hovering over a window’s green maximize button and choosing a tile side.
- Switch desktops:
Control + Left/Right Arrow, or swipe horizontally with three or four fingers after enabling the gesture in System Settings → Trackpad → More Gestures.
Multi-Monitor Dock Behavior
If the Dock moves to a secondary display:
- Enable auto-hide:
Option + Command + D. - Move the pointer to the bottom center of the desired primary display and pause until the Dock appears.
- Lock the Dock to that screen by pressing
Option + Command + Dagain to disable auto-hide.
Mouse and Pointer Acceleration
When the GUI tracking speed slider is insufficient, increase it via Terminal:
defaults write -g com.apple.mouse.scaling -float 7.0
Restart the computer to apply. Avoid adjusting the slider afterward in System Settings, as it may reset the custom value.
Finder and File System
Default View Modes
Open a folder in Finder, right-click, and choose Show View Options. Enable Always open in column view to enforce the layout for that directory.
New File Quick Action
Use Automator to create a Quick Action that adds a New File entry to Finder’s context menu:
on run {input, parameters}
tell application "Finder"
make new file at (get insertion location)
end tell
return input
end run
Save the workflow and ensure it is enabled under System Settings → Privacy & Security → Extensions → Added Extensions.
Open with VS Code from Finder
Create an Automator Quick Action that receives files or folders and runs a shell script:
for item in "$@"
do
open -b "com.microsoft.VSCode" "$item"
done
Save it as a service. It will appear in the right-click menu when files are selected.
Terminal Utilities
Clipboard Integration
macOS provides pbcopy and pbpaste for clipboard interaction.
Copy command output directly:
cat config.json | base64 | pbcopy
Redirect cilpboard contents to a file:
pbpaste > notes.txt
pbpaste >> log.txt
Transform clipboard data before writing it back:
pbpaste | sort | uniq | pbcopy
pbpaste | rev | pbcopy
pbpaste | wc -l
Opening Files from the Command Line
- Open with the default application:
open index.html - Open with a specific application:
open -a "Google Chrome" report.html open -a "Sublime Text" ./src
Installing wget from Source
When a package manager is unavailable, compile manually:
curl -O http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz
tar -xzf wget-latest.tar.gz
cd wget-*/
./configure --with-ssl=openssl
make
sudo make install
Browser and Network
- Refresh page:
Command + R - Hard refresh (bypass cache):
Command + Shift + R - Clear browsing data:
Command + Shift + Delete - Retrieve a saved WiFi password from Keychain via Terminal:
security find-generic-password -ga "NETWORK_NAME" | grep "password:"
System Administration and Security
Bypassing Gatekeeper for Unsigned Binaries
To run a downloaded binary blocked by macOS security:
xattr -dr com.apple.quarantine /path/to/executable
Alternatively, approve the application under System Settings → Privacy & Security.
AirDrop Transfers
Ensure both devices are on the same network and set AirDrop visibility to Contacts or Everyone. Drag files onto the recipient icon; File Sharing does not need to be enabled.
Power Adapter Interchangeability
iPad and MacBook USB-C chargers are cross-compatible. A lower-wattage iPad adapter will charge a MacBook slowly, while a MacBook adapter can charge an iPad faster. For optimal battery health, use the adapter shipped with each device.
Input Method Configuration
Key Repeat Speed
Override the maximum key repeat rate set by the GUI:
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 12
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
Restart the Mac to activate. The last command disables accent menus so holding a key repeats the character instead.
English Punctuation in Chinese Input
The native Pinyin input’s half-width punctuation setting may not apply consistently. Third-party input methods such as Sogou provide an explicit Use English punctuation in Chinese mode option, which applies globally or per application.