Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change VS Code's limits on number of search results and multiple cursors for the Select All Occurrences of Find Match command?

enter image description here

I want to find and replace using regex in the same file. Actually, it's a huge file.

I want to increase the results to consider higher or all occurrences.

in the settings:

"search.maxResults":

not helpful because I want to increase the results for the search in the same file.

if there is no official way, I will be happy if there is an extension to do it.

I use (control + shift + l) to highlight all occurrences then move the cursor some spaces and change all the occurrences. the highlighting stuff is only for 19999. it is not just replace

like image 432
Watheq Alshowaiter Avatar asked Oct 26 '25 06:10

Watheq Alshowaiter


1 Answers

For the Select All Occurrences of Find Match, you need to increase the value of the editor.multiCursorLimit. The default value is 10,000.

I just did a simple test with 20k "abc" in a file, and replaced all with "def". Even thought the widget said "19999+", it replaced all instances. I'd suggest you just try it if you haven't already. I think it will work just the way you want it to. Though it won't highlight any more matches than specified by the search.maxResults setting unless you set it to null to allow for unlimited matches.

Some related issue tickets- some historical, some still open:

like image 194
starball Avatar answered Oct 28 '25 20:10

starball



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!