Skip to main content


NameCharacterkbdPhysical key
Command⊞ Windows
Option / AltAlt


What prevents Mac to sleep: pmset -g assertions. See

Keyboard Shortcuts

Mac keyboard shortcuts

Cycle current application’s windows: + `

Character Viewer (emoji picker): + Ctrl + Space

Show/hide hidden files: + Shift + .

All my macOS keyboard shortcuts - -

Add sleep shortcut

Monterey: Preferències -> Teclat -> pestanya Dreceres -> Dreceres de l'app. Ventura: Configuració -> Teclat -> Dreceres de teclat... -> Dreceres de l'app. Afegir 2 dreceres noves amb nom 'Sleep' i 'Repòs' a ShiftAltQ. Haig de veure el shortcut ⌥⇧Q al menu del sistema.


"^u" = "deleteWordBackward:";
"^o" = "deleteWordForward:";
"^j" = "moveWordBackward:";
"^l" = "moveWordForward:";

Place this file in ~/Library/KeyBindings/ (create the folder if it doesn't exist yet).

Note that you need to restart the apps to take effect (eg run killall Finder to restart Finder, close and open Firefox etc.).




I've already added these shortcuts in the past. Thus, to have them in a new iTerm2 installation, I don't have to add them manually again, I can simply import either the profile .json file or the .itermkeymap file.

Note that the .json profile contains all the shortcuts of the .itermkeymap file, so if we import the profile we don't have to import the .itermkeymap afterwards.

Go to Preferences -> Profiles tab -> Keys tab -> Key Mappings tab. Click the + button.

Alt+← Ctrl+jMove word leftSend Escape Sequenceb
Alt+→ Ctrl+lMove word rightSend Escape Sequencef
Ctrl+uDelete word leftSend Hex Codes0x1b 0x08 (could instead be 0x17, see StackOverflow below)
Ctrl+oDelete word rightSend Hex Codes0x1b 0x64

"send hex code" vs "send escape sequence"


  • “send escape sequence” simply sends a “\e” followed by the text as-is
  • “send hex code” scans for one 8-bit code, and sends that
  • “send text” allows for “\e” (escape), “\n” (newline), “\a” (bell), and “\t” (tab), and normal text


Used by Little Snitch and Razer Synapse.

Are located in /Library/Extensions/.

Free up disk space

  • Delete node_modules folders with npkill. Usage: npx npkill --directory ~/Programming.
  • Delete build folders: find . -type d -name "build" -exec rm -rf {} +.
  • Delete Python venv folders: find . -type d -name "venv" -exec rm -rf {} +.
  • Xcode
  • JetBrains IDEs, delete old versions: Help -> Delete Leftover IDE Directories…
    • JetBrains IDEs are located at ~/Library/Application Support/JetBrains (cd ~/Library/Application\ Support/JetBrains).
    • Android Studio is located at ~/Library/Application Support/Google (cd ~/Library/Application\ Support/Google).
  • Docker:
    • Docs: Prune unused Docker objects:
    • Remove dangling images (images with <none> in docker image ls): docker image prune (docs)
      • IMPORTANT: be careful with docker image prune -a because it deletes plenty of stuff, eg it has deleted all images shown by docker image ls, not only the ones with <none>! It says WARNING! This will remove all images without at least one container associated to them..
    • Pune everything: docker system prune. This removes all stopped containers, all networks not used by at least one container, all dangling images and all build cache.
  • Anar a ~/Library/Application Support i esborrar programes antics.
  • Esborrar fitxers grans: Sobre aquest Mac -> Emmagatzematge -> Gestionar...
  • Telegram: esborrar la memòria cau (pot tenir 1 GB). Es fa a "Ús de l'emmagatzematge"
  • Firefox: esborrar dades del lloc (pot ser 3 GB). Anar a Preferències -> Privadesa i seguretat -> Gestiona les dades... S'ordenen per mida. Cal apretar Delete a cada Lloc i després 'Desa els canvis' (sinó no esborra). Esborrar les que fa més d'un any que es van fer servir ('Darrer ús').