12 Visual Studio Code Shortcuts For Faster Coding by@davis-dambis

12 Visual Studio Code Shortcuts For Faster Coding

image
Dāvis Dambis HackerNoon profile picture

Dāvis Dambis

Up-And-Coming Full Stack Developer

There are some great tools and extensions that might help your coding experience enjoyable in the VS Code. That is great and all but there might be a chance you are missing out on some great shortcuts that VS code offers. That is why this article is here to help you with some of the most useful shortcuts for faster coding.

Here is the list of 12 Visual Studio Code Shortcuts:Β 

1. Add Selection To Next Find Match (Ctrl+D)Β 

This is one of my favorite shortcut. It will find matching text that you’ve highlighted and you can do whatever you want. For example, you have a list in HTML that you’ve made but you wish to change its class name but it might be tedious, but with CTRL+D you can make that tedious task an easy fix:

image

Or you can just copy over it:

image

1.1 Alternative to Ctrl+D (Ctrl+F2)

It does the same thing as Ctrl+D but instead will select all of them instantly without a need to press it repeatedly unlike with Ctrl+D. But be careful with this shortcut because if the selected word is somewhere else within the file then it will be overridden with whatever you decided to override it with:Β 

image

2. Search for a keyword throughout the project folder (Ctrl+Shift+F)

This is another powerful feature that can find specified keyword throughout all the files in your project folder and you can replace all the searched keywords as well:

image

Or you can specify which files or lines you want to exclude from replacement by clicking the dismiss on the file or line you wish not be changed:

image

3. Delete previous word (Ctrl+Backspace)

A handy one if you ever make a typo and just want to type it again:

image

4. Delete line (Ctrl+X)

If you want to delete a whole line then Ctrl+X can take care of that:

image

5. Select words (Ctrl+Shift+Arrow keys)

With Ctrl+Shift+Arrow keys you can select text word by word:

image

6. Jump to the beginning or end file (Ctrl+Home/Ctrl+End)

If you want to quickly jump to the beginning then Ctrl+Home or if you want to get to the end of file then Ctrl+End:

image

7. Move a line (Alt+Up/Down Arrow keys)

If you ever by mistake wrote code in the wrong line and want to move it to correct one without copy/pasting then Alt + Up/Down arrow keys will help:

image

8. Add cursor Up/Down (Ctrl+Alt+Up/Down Arrow keys)

If you ever find yourself in need to edit multiple lines with the same text use Ctrl+Alt+Up/Down and combined with Ctrl+Shift+Arrow left or right key can save you tons of time:

image

9. Duplicate a line above or below (Shift+Alt+Up/Down Arrow keys)

This shortcut simply duplicates a line on a new line either above or below:

image

10. Fold or unfold code (Ctrl+Shift+[ or ])

With Ctrl+Shift+[Β  to fold or Ctrl+Shift+] to unfold code:Β 

image

11. Navigate to a specific line (Ctrl+G)

To quickly navigate a specific line Ctrl+G of the selected file:

image

12. Column box selection (Shift+Alt+Cursor)

This will simply select text in a column box way:

image

Conclusion

This concludes the shortcut list. I hope these are helpful and will help you code a little faster and with less hassle.

You can find all the shortcuts here:

Tags