Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change lines at the same time - VS Code

I want to change same lines at the same time. for example I want to change { backgroundColor: '#fff' } at anywhere on my file.js. (I don't want to use Replace)

enter image description here

like image 835
S.M_Emamian Avatar asked Dec 07 '25 04:12

S.M_Emamian


2 Answers

Select { backgroundColor: '#fff' } with your mouse and press cmd + shift + L (or ctrl + shift + L) to select all occurrences of it in your file. Then, you can change them all at the same time.

like image 74
Ridvan Sumset Avatar answered Dec 08 '25 19:12

Ridvan Sumset


Try

  1. Ctrl + F (backgroundColor: '#ufff')
  2. Alt + Enter

This will select every instance and give each an active cursor. Hit Esc to exit multi cursor mode.

like image 38
Garret Avatar answered Dec 08 '25 19:12

Garret



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!