Reputation: 520
When you search for a string in Visual Studio Code with Ctrl-F it doesn't display number of occurrences.
Is it possible to find out somehow?
On the other hand it displays a number of hits next to a filename when you search all files with Ctrl-Shift-F.
Upvotes: 18
Views: 20051
Reputation: 75
click the down faced triangle and then choose 'find all'
and then the matched string number should be visible on the bottom left:
Upvotes: 1
Reputation: 21
On Windows, you can count string occurrences with the command FIND /C "string you're searching" filename.txt
So on VSCode, you can open the console (ctrl + ') and type the command. It's one workaround to count string on large files without have to install any new extensions.
Upvotes: 1
Reputation: 374
I had the same problem as csonuryilmaz mentioned in the comment to this answer, I needed the exact count of the string, even if it is 19999+. I ended up opening the file in Notepad++, there you can count all occurences when searching for a string.
Maybe not the best solution if you want/have to use only Visual Studio Code, but for my problem this was a good enough workaround.
Upvotes: 20
Reputation: 636
Once you have the search bar pulled up with Ctrl-F, click the triangle on the left side of the search bar. The occurrence count of your search term will be displayed.
Happy coding!
Upvotes: 15