Skip to content

Latest commit

 

History

History
211 lines (131 loc) · 3.85 KB

VSCode-CheatSheet.md

File metadata and controls

211 lines (131 loc) · 3.85 KB

VS Code Cheat Sheet

Go to File

Ctrl + P

My replacement for Ctrl + Shift + R in Eclipse.

Go to Symbol

Ctrl + Shift + O

My replacement for Ctrl + O in Eclipse.

Code Navigation

Vertical Editing

Change Repeating Multi-line String

Ctrl + F
Alt + Enter

Multiline editing in Visual Studio Code

Edit Settings.json

Ctrl + Shift + P

Then type "open settings."

Code Formatting

  • On Windows Shift + Alt + F
  • On Mac Shift + Option + F
  • On Ubuntu Ctrl + Shift + I

https://stackoverflow.com/a/29973358/6146580

See also the Prettier VSCode Extension.

Delete Line

Shift + Del

Delete a line in Visual Studio without copying it?

Toggle Comment

Ctrl + K + C
Ctrl + /

Column Select

Shift + Alt then drag mouse
Ctrl + Shift + Alt then arrow keys

Selecting columns in Visual Studio Code

Open Terminal

Ctrl + `

Markdown Preview

Ctrl + Shift + V To switch between views

Ctrl + K V Side-by-side

https://code.visualstudio.com/docs/languages/markdown

Open with VS Code

I wasn't paying attention to the installer and missed this feature. 😦

Open with Code

Computer\HKEY_CLASSES_ROOT\Directory\shell\vscode

Win Reg

Open with VS Code from right click in Windows Explorer

Java

JVM Arguments

In launch.json

"vmArgs": [
    "-Xms256m",
    "-Xmx256m",
    "-XX:+HeapDumpOnOutOfMemoryError",
    "-XX:HeapDumpPath=${workspaceFolder}/gc.hprof"
]

Launch Options

Organize imports

Alt + Shift + O (Windows)
Option + Shift + O (Mac)

Is there a way to remove unused imports and declarations from Angular 2+?

HTML

HTML in Visual Studio Code

Emmet

New HTML Template

Emmet abbreviation for new HTML document.

! + Tab

Output:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body></body>
</html>

Extensions

GitLens

Accept All Incoming Changes

Ctrl+Shift+P merge
Merge Conflict: Accept All Incoming

Merge

How can I accept all current changes in VSCode at once?

Docker

REST Client

Prettier

Settings >> Editor: Format On Save

Prettier - Code formatter (On GitHub)

See also js-beautify for VS Code.

CSS Peek

Go To Definition and Go To Symbol in Workspace support for CSS.

CSS Peek

Material Icon Theme

Material Icon Theme

Visual Studio IntelliCode

Remote-WSL

Live Server

Python

Auto Rename Tag

Auto Rename Tag

Shades of Purple

Peacock