Skip to content

Instantly share code, notes, and snippets.

@Abhinav1217
Last active January 10, 2026 14:55
Show Gist options
  • Select an option

  • Save Abhinav1217/551b08792062e24713e1c5fbac451300 to your computer and use it in GitHub Desktop.

Select an option

Save Abhinav1217/551b08792062e24713e1c5fbac451300 to your computer and use it in GitHub Desktop.
Mac OS Tricks

--- some tricks for macos

To exit Finder using cmd+Q use this command

defaults write com.apple.finder QuitMenuItem -bool YES && killall Finder

This won't remove it from dock though.

To Revert

defaults write com.apple.finder QuitMenuItem -bool NO && killall Finder

Additional Finder tweaks

# Show full path in Finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true && killall Finder

# Always show all file extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Disable warning when changing file extensions
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Prevent .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

# Disable reopening windows on restart
defaults write com.apple.loginwindow TALLogoutSavesState -bool false

Screensaver tricks.

# Change screenshot location
mkdir -p ~/Screenshots
defaults write com.apple.screencapture location ~/Screenshots && killall SystemUIServer

# Save screenshots as PNG
defaults write com.apple.screencapture type -string "png" && killall SystemUIServer


Disable MacBook typing autocorrects and text replacements. You need to restart system for them to take effects.

# Disable automatic spelling correction (autocorrect)
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

# Disable smart quotes (curly quotes)
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false

# Disable smart dashes (en/em dashes)
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false

# Disable automatic capitalization
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false

# Disable automatic period substitution (double-space → .)
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false

Text Replacement is an array. To disable it, set it to empty.

# Disable text replacement shortcuts
defaults write NSGlobalDomain NSUserDictionaryReplacementItems -array

To enable it, assign replacement array

defaults write NSGlobalDomain NSUserDictionaryReplacementItems -array \
  '{ on = "omw"; replace = "On my way!"; }' \
  '{ on = "macbook"; replace = "MacBook"; }' 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment