Published on

VS Code: Select All Occurrences of Current Selection

Authors

When I want to change some variable name or something, I usually hit Cmd + D over and over again to select all occurrences.

I wish I'd learned this before to save so much time ๐Ÿ˜…

VS Code has a feature to do that instantly

How to do it?

  1. Select the word
  2. Select Select all Occurrences of Find Match in Command Palette

Shortcuts

  • In MacOS, you can use โ‡งโŒ˜L (Shift + Cmd + L) to do it. Similarly, in Windows, you can use Ctrl+Shift+L shortcut

References

Happy selecting texts!