DEV Community

KenjiGoh
KenjiGoh

Posted on • Edited on

VS Code Shortcut Keys

Save time, because time is more important than money.
List is non-exhaustive, will add more along the way.

Default Shortcut Keys

Open Terminal for the current working file

Ctrl + `
Enter fullscreen mode Exit fullscreen mode

Split work screen

Ctrl + \
Enter fullscreen mode Exit fullscreen mode

Close Current work screen

Ctrl + W
Enter fullscreen mode Exit fullscreen mode

Collapse Explorer side bar

Ctrl + B
Enter fullscreen mode Exit fullscreen mode

Alternate between 2 work screens

Alt + 1 and Alt + 2
Enter fullscreen mode Exit fullscreen mode

Search files

Ctrl + P
Enter fullscreen mode Exit fullscreen mode

Swap line of codes

Alt + up or down key
Enter fullscreen mode Exit fullscreen mode

To edit same lines at one go

Ctrl + alt + up or down key
Enter fullscreen mode Exit fullscreen mode

Image description

Configure Global Snippets

Go File > Preferences > User Snippets > Global Snippets

  "console.log": {
    "scope": "javascript,typescript",
    "prefix": "cl",
    "body": ["console.log('');"],
    "description": "Log output to console"
  }
Enter fullscreen mode Exit fullscreen mode

Prevent auto conversion of single-quote to double-quotes

Go File>Preferences>Settings and search for prettier.singleQuote. Now check to true.
Image description

Cheers!

Top comments (0)