MANUAL

Keyboard shortcuts in VS Code and the terminal

Keyboard shortcuts in VS Code and the terminal

Keyboard shortcuts help you work faster and give you a better overview of what your AI assistant is doing. This guide accompanies Installing Visual Studio Code.

01

Start by remembering just one

**Ctrl+Shift+P

02

Navigate

What Windows / Linux Mac
Open file by name Ctrl+P Cmd+P
Go to line Ctrl+G Ctrl+G
Go to the definition F12 F12
Search all files Ctrl+Shift+F Cmd+Shift+F
Search this file Ctrl+F Cmd+F
Sidebar on/off Ctrl+B Cmd+B
Terminal on/off Ctrl+` Ctrl+`

03

Edit

What Windows / Linux Mac
Select the next matching word as well Ctrl+D Cmd+D
Extra cursor above/below Ctrl+Alt+↑/↓ Option+Cmd+↑/↓
Additional cursor where you click Alt+click Option+click
Move line up/down Alt+↑/↓ Option+↑/↓
Copy line up/down Shift+Alt+↑/↓ Shift+Option+↑/↓
Delete line Ctrl+Shift+K Cmd+Shift+K
Delete previous word Ctrl+Backspace Option+Backspace
Go to the start/end of the line Home / End Cmd+← / →
Show/hide comments Ctrl+/ Cmd+/
Format document neatly Shift+Alt+F Shift+Option+F
Show suggestions Ctrl+Space Ctrl+Space
Save all Ctrl+K, then S Option+Cmd+S

04

Improve the code

What Windows / Linux Mac
Quick fixes / actions (including ‘Extract method’) Ctrl+. Cmd+.
Change name everywhere F2 F2

05

Debugging

What Test
Breakpoint on/off F9
Start / Continue F5
Skip F10
Step in F11
Exit Shift+F11

06

Customising keyboard shortcuts

Ctrl+K, Ctrl+S (Mac: Cmd+K, Cmd+S) opens the list of all keyboard shortcuts. Find a command, double-click it and enter your own shortcut combination.

07

Inside the terminal

What Test
Stop running command Ctrl+C
Clear screen Ctrl+L
Search previous commands Ctrl+R
Previous command ↑

08

Stuck in Vim?

Sometimes Git opens an editor called Vim, for example when you make a commit or perform a rebase. Here’s how to close it:

  1. Press Esc.
  2. Type :wq**

Would you like Git to use VS Code from now on?

git config --global core.editor "code --wait"

A few Vim shortcuts you might come across: gg (move up), G (move down), dd (delete line), yy (copy line), p (paste), ciw (replace word), u (undo).

09

Tip for your AI assistant

With the editor-shortcuts skill, your assistant can provide you with the correct keyboard shortcut for your system, or set up a custom shortcut for you.

10

Skills