Most Xcode shortcuts carry over to VS Code. With the free KXApp extension installed, the three you use most work right away: ⌘R to build and run, ⌘B to build, and ⌘. to stop. Most other actions have their own VS Code shortcuts, such as ⌘P to open a file quickly, F12 to go to a definition and ⌃- to go back, and you can rebind any of them to the Xcode keys you’re used to. Below are cheat sheets for common actions and how to remap keys, based on VS Code’s default macOS keybindings as of October 2026.
If you haven’t installed the extension yet, follow the install page; the quick start covers the first steps.
Which Xcode shortcuts work for build, run and debug?
| Action | Xcode | VS Code + KXApp |
|---|---|---|
| Build and run | ⌘R | ⌘R (from the extension) |
| Build | ⌘B | ⌘B (from the extension) |
| Stop | ⌘. | ⌘. (from the extension) |
| Clean build folder | ⇧⌘K | Clean Build Folder in the Command Palette, or the “…” menu in the Xcode Project view title bar |
| Run tests | ⌘U | Run button in the Test Explorer |
| Start debugging / continue | ⌘R / ⌃⌘Y | F5 |
| Step over | F6 | F10 |
| Step into | F7 | F11 |
| Step out | F8 | ⇧F11 |
| Toggle breakpoint | ⌘\ | F9 |
The three extension shortcuts only apply under certain conditions:
- ⌘R and ⌘B work only when the editor has focus and an Xcode project is open. In that case ⌘B is no longer VS Code’s “Toggle Sidebar”; anywhere else (focus in the sidebar, or a folder that isn’t an Xcode project) ⌘B still toggles the sidebar.
- ⌘R does nothing while a debug session is running. To rerun after changing code, press ⌘. to stop first, then ⌘R.
- ⌘. works only while a run or debug session started by the extension is active; otherwise it’s VS Code’s default Quick Fix.
What are the VS Code shortcuts for editing and navigation?
| Action | Xcode | VS Code |
|---|---|---|
| Open a file quickly | ⇧⌘O | ⌘P |
| Go to a symbol in the current file | ⌃6 | ⇧⌘O |
| Find a symbol in the whole project | ⇧⌘O | ⌘T |
| Go to definition | ⌃⌘J or ⌘-click | F12 or ⌘-click |
| Find references | Right-click › Find › Find Call Hierarchy, etc. | ⇧F12 |
| Go back / forward | ⌃⌘← / ⌃⌘→ | ⌃- / ⌃⇧- |
| Go to line | ⌘L | ⌃G |
| Toggle comment | ⌘/ | ⌘/ |
| Find in file | ⌘F | ⌘F |
| Find in project | ⇧⌘F | ⇧⌘F |
| Rename symbol | Refactor › Rename | F2 |
| Show / hide the left sidebar | ⌘0 | ⌘B (used for building by the extension when an Xcode project is open and the code editor has focus) |
| Command Palette | — | ⇧⌘P |
Note that ⇧⌘O means different things in the two editors: in Xcode it’s Open Quickly, in VS Code it jumps to a symbol in the current file. VS Code’s quick open is ⌘P.
How do I remap VS Code shortcuts to match Xcode?
- Press ⌘K ⌘S (press ⌘K, release, then press ⌘S) to open Keyboard Shortcuts.
- Search for the command you want to change. Typing
kxapplists all of the extension’s commands: Build & Run, Build, Stop, Clean Build Folder, Run Without Debugging, Run Without Building, Attach to Running App… - Double-click a command, press the keys you want, and hit Enter to save.
You can also click the icon in the top-right corner to open keybindings.json and edit it directly. For example, to bind Clean Build Folder to Xcode’s ⇧⌘K:
1[
2 { "key": "shift+cmd+k", "command": "kxapp.clean", "when": "editorTextFocus" }
3]
By default ⇧⌘K in VS Code is “Delete Line”; with this binding, ⇧⌘K in the editor cleans the build folder instead. Before you change a key, search for it in Keyboard Shortcuts to see what you’ll be overriding.
If you want the full Xcode keymap, search the Extensions view for an “Xcode Keymap” style extension. It may overlap with KXApp’s ⌘R, ⌘B and ⌘.; after installing it, search those keys in Keyboard Shortcuts and keep one binding each, so your Xcode shortcuts in VS Code don’t conflict.
FAQ
Why does nothing happen when I press ⌘R?
Click into the code editor first so it has focus, then press it again; ⌘R also does nothing during a debug session, so press ⌘. to stop first. You can also click the Build & Run button (▶) in the Xcode Project view title bar, or run “kxapp: Build & Run” from the Command Palette.
⌘B used to toggle the sidebar. Is that gone?
Only while the editor has focus and an Xcode project is open does ⌘B build. With focus in the sidebar, or in a folder that isn’t an Xcode project, ⌘B still toggles the sidebar; you can also use View › Appearance.
Are these shortcuts the same in Cursor?
The extension’s ⌘R, ⌘B and ⌘. work the same in Cursor; for other editing and navigation shortcuts, check Cursor’s Keyboard Shortcuts settings.
Can I set ⌘U to run tests?
Yes. Search for “Test: Run All Tests” in Keyboard Shortcuts and bind it to ⌘U.