DEV Community

VS Code Shortcuts for code newbies [mac/windows][GIF]

Suborna on December 08, 2019

As a codeNewBie I realised the importance of shortcuts as soon as I started programming. Shortcuts not only allowed me to code quicker but it also ...
Collapse
 
justinemmanuelmercado profile image
Justin Emmanuel Mercado • Edited

Another shortcut I've been using a lot is
- Mac -(while selecting a text) ⌘ + L
- Windows - (while selecting a text) Ctrl + L

It selects all texts similar to your currently selected text.

Edit.

My bad, the above is wrong. It's supposed to be

  • Mac -(while selecting a text) ⌘ + Shift + L or ⌘ + D
  • Windows - (while selecting a text) Ctrl + Shift + L or Ctrl + D
Collapse
 
iraamoni profile image
Suborna

I have seen this shortcut before and it would have been a really amazing shortcut only if it was working on my mac. For some reason everytime I press ⌘ + L it says, waiting for second key of chord..

Any idea why this might be happening?

Collapse
 
justinemmanuelmercado profile image
Justin Emmanuel Mercado

My bad, what I initially commented was wrong. Check my edit

Thread Thread
 
iraamoni profile image
Suborna

hehe no worries. I would prefer ⌘ + D as it's easier for me to remember. I should add it to my shortcuts :D Thank you

Collapse
 
mdhesari profile image
Mohammad Fazel

In windows it was ctrl + d I think

Collapse
 
iraamoni profile image
Suborna

I have just tried ⌘ + D and it did something quite interesting. If clicked once, it selects all the similar word, and if clicked twice it creates multiple cursors on the selected texts, which is really interesting!! Thank you

Collapse
 
jannikwempe profile image
Jannik Wempe

Thanks for the list :-)

Two Windows shortcuts are wrong (at least for me?):
The beginning/end of a code line: Ctrl + Pos1 / End
Split the code editor: Ctrl + ^ (maybe only for non-US keyboard layouts?)

Collapse
 
iraamoni profile image
Suborna

Hey Jannik, it might depend on your keyboard layout unfortunately because it seems to working on other windows systems :(