Title: macOS Cheatsheet
Slug: macos-cheatsheet
Author: Kartones
Lang: en
Description: A cheatsheet of macOS keyboard symbols, layouts, shortcuts, and other tips.

## macOS Symbols

- `⇧`: Shift
- `⌃`: Control
- `⌥`: Option
- `⌘`: Command
- `🌐`: Globe / Fn (note: usually not available on non-Apple keyboards)

## Keyboard Layouts

- [EN-US 🇺🇸](https://images.kartones.net/posts/kartonesblog/macos-keyboard-us.png){:target="\_blank"}
- [ES 🇪🇸](https://images.kartones.net/posts/kartonesblog/macos-keyboard-es.png){:target="\_blank"}
- [SE 🇸🇪](https://images.kartones.net/posts/kartonesblog/macos-keyboard-se.png){:target="\_blank"}

## OS Shortcuts

- **⌘ + space**: Spotlight (search)
- **⌃ + ⌘ + Q**: Lock screen/computer
- **⌃ + ⌘ + V**: Paste text without formatting
- **⇧ + ⌘ + 3**: Screenshot - entire screen (saved in desktop)
- **⇧ + ⌘ + 4**: Screenshot - draw region (saved in desktop)
- **⌃ + ⇧ + ⌘ + 3**: Screenshot - entire screen (copied in clipboard)
- **⌃ + ⇧ + ⌘ + 4**: Screenshot - draw region (copied in clipboard)
- **`Fn` + Up/Down**: Text scroll page up/down
- **`Fn` + Del**: Text forward delete
- **^ + ⌘ + Space**: Insert emoji
- **⌃ + ⌘ + F**: Toggle full-screen
- **⌥ + Left/Right**: Go to next/previous word
- **⌘ + Left/Right**: Go to start/end of current line
- **⌘ + Tab**: Cycle through open apps
- **⌘ + `** (backtick): Cycle through windows of the same app (when 2+ are open/running)
- **⌃ + Tab**: Cycle through open tabs (Chrome, VSCode, etc.)
- **⌘ + Del**: Delete a file
- **⌘** when dragging a file: Move the file (instead of copying it)
- **⌘** when dragging menu bar items: Reorder the icons (note that some might change order again in the future)
- **⇧ + space**: Next input source (default is too cumbersome)
- **space**: when having one or more files selected at Finder: Preview the file(s)

## App Shortcuts

### Web Browsers

- **⌘ + R**: Reload tab
- **⌘ + W**: Close tab
- **⌘ + T**: Open new tab

### Google Meet

- **⌘ + D**: mute/un-mute microphone

### Rectangle (personal shortcuts)

- **⌃ + ⌥ + Left**: Move to left half
- **⌃ + ⌥ + Right**: Move to right half
- **⌃ + ⌥ + Up**: Move to upper half
- **⌃ + ⌥ + Down**: Move to lower half
- **⌃ + ⌥ + Enter**: Maximize
- **⌥ + ⌘ + -**: Make window smaller
- **⌥ + ⌘ + =**: Make window bigger

### Terminal

- **⌃ + R**: reverse search

### Vim

- Fix no colors: `echo "syntax on" >> ~/.vimrc` from a terminal

### VSCode

- **⌘ + F**: Find text in open file
- **⇧ + ⌘ + F**: Find text in all project files
- **⌘ + P**: Find file
- **⌃ + -**: Go back
- **⌃ + G**: Go to (often, go to a specific line number)
- **^ + Tab**: Cycle through tabs (open files)
- Select multiple lines, then **⇧ + ⌥ + I**: Multi-line editing
- **⌥ + ⌘ + T** (customized shortcut): Enable/Disable Copilot Completions

## Tools

[brew/Homebrew](https://brew.sh/): **The** package manager for macOS. Required for many of the tools.


- 7Zip: `brew install sevenzip` + `7zz` from terminal.
- [BetterCapture](https://bettercapture.app/): Free full-featured screen recording.
- [CotEditor](https://coteditor.com/): Better replacement for TextEdit, but still fast and not feature-bloated.
- [Disk Space Analyzer](https://nektony.com/disk-expert): Check where is your used space located. The free version is more than capable.
- [eza](https://eza.rocks/): Better `ls`, with features like hyperlinks. My config (invoked via `l`):
```
# add to .zshrc or similar
alias l='eza -l --icons --hyperlink --color=auto'
```
- Flushing DNS cache: `sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder`.
- [Funter](https://nektony.com/funter): Tool to show/hide hidden files in Finder. As an alternative, you can enable displaying hidden files system-wide from a terminal via `defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder;`.
- Git:
```
brew install git
```
- I disable the [zsh globbing pattern matching](https://superuser.com/a/982399) because can collide with command lines that include `*` or `?`. Otherwise, you can run commands prefixed with `noglob ` ([source](https://unix.stackexchange.com/questions/580929/zsh-disable-globbing-for-certain-commands-or-patterns)) to explicitly disable the pattern matching just there.
- [KeePassXC](https://keepassxc.org/): My preferred password manager.
- [Kitty](https://sw.kovidgoyal.net/kitty/): Lightweight and fast terminal.
- [jq](brew install jq): The command-line JSON parser.
- NodeJS:
```
# install (specific LTS version)
brew install node@22
npm install -g npm
# updates
brew upgrade node@22
npm install -g npm
```
- [Menu Bar Spacing](https://sindresorhus.com/menu-bar-spacing): Allows to compact the menu bar items.
- [noTunes](https://github.com/tombonez/noTunes): Because who would ever want to disable Apple Music, you can't do it easily. This open-source tool allows you not only that, but also to set any other application as the default app for music.
- [OBS Studio](https://github.com/obsproject/obs-studio): The ultimate (free) application for live streaming and screen recording.
- [OmniDiskSweeper](https://www.omnigroup.com/more): Check where is your used space located. Simple, but free. 
- [OpenSuperWhisper](https://github.com/starmel/OpenSuperWhisper): macOS dictation app, with local models.
- [Pinta](https://www.pinta-project.com/): FOSS image editing software.
- Python: Using `brew`, you can install multiple Python versions, e.g. `brew install python@3.11`.
- [Rectangle](https://rectangleapp.com): Allows decent moving and resizing of windows. Highly customizable.
- [Standard Notes](https://standardnotes.com/): A simplistic alternative to take notes. Free version is restricted to text-only, but still provides sync. 
- [The Unarchiver](https://theunarchiver.com/): To open most compressed file formats.
- [tree](https://bstil22.github.io/2015/03/15/adding-tree-to-zsh/): Add a `tree` command via a simple zsh alias: `alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"`.
- [VMware Workstation Pro](https://blogs.vmware.com/workstation/2024/05/vmware-workstation-pro-now-available-free-for-personal-use.html): It is now free for personal usage. Windows 11 runs quite well on it, but guest OS are limited to ARM versions.
- You can install `watch` on macOS via `brew install watch`, and back to running tests in loop or checking when a process runs (via `'pgrep -fl <app>'`)
- XCode [CodeThemes](https://www.codethemes.net/): Themes for the IDE. To install them, copy the file(s) to `~/Library/Developer/Xcode/UserData/FontAndColorThemes/` (create the folder if does not exist).

### Gaming-Related

- [Mac Source Ports](https://www.macsourceports.com/): macOS Builds of FOSS game engines.
- [AppleGamingWiki](https://www.applegamingwiki.com): Compatibility lists for many Windows games, to see if you can run them via Parallels, Crossover, or any other way.
- [Porting Kit](https://www.portingkit.com/games): Wine for macOS, using Metal.

## Miscellaneous

### Fixes and Tweaks

- How to remove the annoying and inconsistent menu icons: `defaults write -g NSMenuEnableActionImages -bool NO` in a terminal, and restart your machine.
- How to [launch vscode from the command line in macOS](https://stackoverflow.com/questions/30065227/run-open-vscode-from-mac-terminal#36882426).
- How to specify a different language than your macOS locale: `export LANG="en_US.UTF-8"` at `~/.zshrc`.
- If you have issues with e.g. Google Chrome accessing other devices in your local network (e.g. `192.168.0.1`), go to `System Settings` ⇾ `Privacy and Security` ⇾ `Local Network` ⇾ Enable Google Chrome there. You might need to clear the browser's cache/history to pick up the changes.
- How to compress a folder into a password-protected zip: Go to terminal and `zip -er <filename>.zip <folder>`.

### Handy Special Characters

- **⌥ + n**, then **n** (`ABC` input source): ñ
- **⌥ + n**, then **⇧ + n** (`ABC` input source): Ñ
- ~ £ €
- ⇾ ← → ⇽ ✅ ❌

### Not actively used Tools

Suggestions of tools I find interesting or used in the past.

- [caffeinate](https://ss64.com/mac/caffeinate.html): Prevent system from sleeping, optionally waiting for a pid to finish.
- [CrystalFetch ISO Downloader](https://apps.apple.com/us/app/crystalfetch-iso-downloader/id6454431289): Free tool to download Windows 10/11 installer ISO images. You need to provide your valid Windows license key.
- [DeskPad](https://github.com/Stengo/DeskPad): Virtual monitor for screen sharing.
- [iTerm2](https://iterm2.com): A better terminal, fast and very customizable.
    - I recommend to change the preset at `Settings` ⇾ `Profiles` ⇾ `Keys` to the `Natural Text Editing` one
- [MemoryCleaner](https://nektony.com/memory-cleaner): Quicker than using the Activity Monitor.
- [P4Merge (Helix Visual Merge Tool)](https://www.perforce.com/downloads/visual-merge-tool): One of the few free visual diff and merge tools for macOS I've found.
- [Picard](https://picard.musicbrainz.org/): A nice audio files tagger, including support for [tagging scripts](https://picard-docs.musicbrainz.org/en/extending/scripts.html#tagging-scripts).
- [Stats](https://github.com/exelban/stats): Menu bar systems monitor.
- [Tomito](https://apps.apple.com/us/app/tomito/id1526042938): Pomodoro timer. Free and without ads.
- [uBlock Origin Lite](https://apps.apple.com/us/app/ublock-origin-lite/id6745342698)
- [UTM](https://mac.getutm.app/): QEMU-based Virtual machine runner. Allows x86 and x64 VMs on ARM hosts, but beware, those are emulared and thus **very slow**.
