DEV Community

Cover image for 20+ Essential VS Code Shortcuts to Become a Ninja Coder (No Mouse Needed!)

20+ Essential VS Code Shortcuts to Become a Ninja Coder (No Mouse Needed!)

Jitendra Choudhary on February 06, 2024

Alone programming is tedious task to do. The constant switch between the keyboard and mouse every few seconds disrupts the flow for developers. Wha...
Collapse
 
moopet profile image
Ben Sinclair

Add a new line to your code without moving your hand from the home row, maintaining a comfortable typing flow.

Could you explain how this is different to pressing enter/return, or what you mean by the home row if we're talking about ctrl/cmd keys?

What's the functional difference between "6 - Split the View" and "22 - View Files Side-by-Side"? They seem to use different shortcuts, but do they do different things?

Collapse
 
jitendrachoudhary profile image
Jitendra Choudhary • Edited

The "22. View File Side-by-Side" lets you follow the cursor. Lets say you are on line 23 the preview will also highlight the line 23. It works better with markdown file.

Let me update the GIF.

Suppose your cursor is here and some text ahead like this and now you hit just enter your cursor will be on the another line along with the bold text highlighted.

On the other hand if you hit "Ctrl/Cmd + enter" the cursor will move to next line alone.(to be more specific it will create a new line). Just try this in your VS Code IDE and you will notice the magic.

Collapse
 
schmoris profile image
Boris • Edited

14) Remove Trailing Whitespace - There's also a setting that does this automatically on save. I can also recommend the extension "rainbow indent" which highlights indentation with subtle color (or red if it's wrong). Happy coding!

Collapse
 
jitendrachoudhary profile image
Jitendra Choudhary

Thanks for sharing! I will have a look at "rainbow indent".

Collapse
 
yogini16 profile image
yogini16

Thanks for sharing this.
This is helpful !!

Collapse
 
jitendrachoudhary profile image
Jitendra Choudhary

I'm so glad you love it!

Collapse
 
ricardogesteves profile image
Ricardo Esteves

Cool, thanks for sharing!

Collapse
 
get_pieces profile image
Pieces 🌟

Thanks for sharing! Super useful commands.

Collapse
 
jitendrachoudhary profile image
Jitendra Choudhary

Awesome! I'm happy it helped.

Collapse
 
bjoentrepreneur profile image
Bjoern

Thanks for sharing this great article. #4 is my favorite. Started to test it immediately and the great thing is, that it works in other apps too, e.g. chrome :)

Collapse
 
moopet profile image
Ben Sinclair

In Chrome that takes me to the very top or bottom of the document, rather than scrolling. If your keyboard has pageup/pagedown keys then these might be better. Browsers also generally recognise "space" as a page-down control, but this obviously won't work if you have an input field with focus.

On a Mac you can us fn+up/down to mimic the pageup/pagedown keys.

Collapse
 
jitendrachoudhary profile image
Jitendra Choudhary

Glad you love it ! If you hit up/down arrow on browser it will still work.

Collapse
 
klimd1389 profile image
Dmytro Klimenko

That was an interesting take on the issue. I think your opinion is really valuable, and I'm glad you shared it with the community.