Skip to content

Visual Studio Cheat Sheet

A copy+pasteable collection of common keyboard shortcuts, tips, and tricks for using Visual Studio Code .

--- Access the command palette -----
cmd + shift + p

--- Manage user settings ----------------
1. Open the command palette (cmd + shift + p)
2. Preferences: Open User Settings (JSON)

--- Install an extension ----------------
cmd + shift + x

--- Hide the sidebar --------------------
cmd + b

--- Find next occurrence of selected text ----------------
cmd + d

--- Find & Replace ----------------
cmd + option + f  <- current file 
cmd + shift + h   <- all files

--- Insert boilerplate html code -----------
type html > select html:5 from the autocomplete suggestions

--- Modify keyboard shortcuts ----------------
code > preferences > keyboard shortcuts

--- Search for filename ----------------
cmd + p

--- Search in all files --------------
cmd + shift + f

--- How to generate multiple cursors ---------
method 1: option + click
method 2: cmd + option + <arrow down>

--- How to set up a new task ------------------------------
3. Open the command palette
4. Tasks: Configure Task
5. From template
6. Other

Helpful notes - https://stackoverflow.com/a/56067344/2146894

--- How to set up a new python project -----
7. File > Open folder
8. Open the terminal (ctrl + backtick)
9. Create a new virtual environment: python3 -m venv .venv
10. Activate it: source .venv/bin/activate

If the python interpreter isn't automatically recognized by VSCode..
11. Open the command palette (cmd + shift + p)
12. Type and choose "Python:Select Interpreter"
13. Select the interpreter
14. Start a new terminal session
--- Access the command palette -----
ctrl + shift + p

--- Manage user settings ----------------
1. Open the command palette (ctrl + shift + p)
2. Preferences: Open User Settings (JSON)

--- Install an extension ----------------
ctrl + shift + x

--- Hide the sidebar --------------------
ctrl + b

--- Find next occurrence of selected text ----------------
ctrl + d

--- Find & Replace ----------------
ctrl + f          <- current file 
ctrl + shift + h  <- all files

--- Insert boilerplate html code -----------
type html > select html:5 from the autocomplete suggestions

--- Modify keyboard shortcuts ----------------
code > preferences > keyboard shortcuts

--- Search for filename ----------------
ctrl + p

--- Search in all files --------------
ctrl + shift + f

--- How to generate multiple cursors ---------
method 1: alt + click
method 2: ctrl + alt + <arrow down>

--- How to set up a new task ------------------------------
3. Open the command palette
4. Tasks: Configure Task
5. From template
6. Other

Helpful notes - https://stackoverflow.com/a/56067344/2146894

--- How to set up a new python project -----
7. File > Open folder
8. Open the terminal (ctrl + backtick)
9. Create a new virtual environment: python3 -m venv .venv
10. Activate it: source .venv/bin/activate

If the python interpreter isn't automatically recognized by VSCode..
11. Open the command palette (ctrl + shift + p)
12. Type and choose "Python:Select Interpreter"
13. Select the interpreter
14. Start a new terminal session