DEV Community

Cover image for VS Code keyboard shortcuts (windows)
Naveenchandar
Naveenchandar

Posted on

VS Code keyboard shortcuts (windows)

Here's the list of vs code keyboard shortcuts.It will work both for workspace and separate folders.

I have windows machine so I will be posting the list related to windows. Sorry mac users :(.

There are lots of vs code inbuilt shortcuts available. If needed you can create a custom shortcuts too.

  1. Ctrl + b (Toggle sidebar) - It is used to toggle the sidebar and the editor workspace.

  2. Ctrl + p (Go to file) - If you are working on a larger applications and if the folder structure is vast then definitely searching for a particular file in the application will be cumbersome. During at that time this shortcut will be very handy.

  3. Ctrl + ` (Toggle Terminal) - It is used to toggle the vs code terminal.

  4. Ctrl + shift + ` (New Terminal) - It is used to open new vs code terminal.

  5. Ctrl + G (Go to line) - It is used to go to particular line number in the current file.

  6. Ctrl + H (Replace) - Suppose your file is too long and if you are using global variable and there is in need of replacing the variable name in all the places of same file. This shortcut is used to find all the matched and replaces them.

  7. Ctrl + F (Find) - It is used to find the search results. It may be a variable name or function name etc.

  8. Ctrl + shift + F (Find) - It is used to search globally all over the projects for the search result.

  9. *Ctrl + * (Split Editor) - It is used to split the editor in to two. This will be very useful while comparing the changes in your files.

  10. Alt + uparrow/downarrow (Move code Up/Down) - It is used to move the selected code up/down from the current line.

  11. Ctrl + n (New file) - It is used to open new untitled file.

  12. Ctrl + shift + N (New window) - It is used to open entire new vs code window.

  13. Ctrl + o (open file) - It is used to open file present in your local system.

  14. Ctrl + K + O (New folder) - It is used to open the entire new folder and this will replace the current folder in vs code.

  15. Ctrl + w (close file) - It is used to close the editor focused file.

  16. Shift + alt + uparrow/downarrow (Copy code up/down) - It is used to copy the same selected code up/down from the current line.

  17. Ctrl + shift + X (Show extensions) - It is used to open the extensions menu available in the sidebar.

  18. Ctrl + shift + E (View explorer) - It is used to open the current project with current file focused on the sidebar.

  19. Ctrl + , (settings) - It is used to open the settings.

  20. Ctrl + shift + M (New file) - It is used to open the terminal with problems tab focused to check the errors and warnings in the current project.Just replace the 'M' to 'U' to focus the output tab.

  21. Ctrl + shift + T (Re-open a Closed Editor) - It is used to open a recently closed file in your current project.

  22. Ctrl + backspace (deletewordleft) - It is used to delete the entire word on the left while typing.

  23. Ctrl + k, z (Toggle Zen mode) - It is used to open the zen mode i.e., without any distractions only the editor space will be focused.

  24. Ctrl + / (Toggle line comment) - It is used to toggle the specific line comment.

  25. Shift + alt + A (Toggle block comment) - It is used to toggle comments between the blocks.

  26. Ctrl + shift + [ (Fold cell) - It is used to fold available code in between the blocks.

  27. Ctrl + shift + ] (Unfold cell) - It is used to unfold available code in between the blocks.

  28. Shift + alt + F (Format document) - It is used to format code in the current file.

  29. Ctrl + k + f (Format selection) - It is used to format the selected code.

  30. Ctrl + shift + c (Open windows terminal) - It is used to open the windows terminal instead of vs code terminal.

To create custom key bindings please check this link.

To see complete list of inbuilt keyboard shortcuts please go through this Link.

This is my first post. Apologize for my grammar mistakes if any and for my bad english. I will improve in my upcoming posts.

Thanks guys for reading this post. See you guys in the next post with list of vscode extensions.

Have a Great Day 😊!!!.

Discussion (0)