Before to publish branch sometimes I want to search for a specific keyword to ensure I have fixed it correctly everywhere. The problem is, I want to search it only in changes not for a whole project.
Is it possible?
Search across files. VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.
You can filter the currently visible files in the File Explorer. With the focus on the File Explorer, press Ctrl/Cmd+F to open the tree Find control and type part of the file name you want to match.
Ctrl + Shift + F – Find in Solution Sometimes you want to search across your entire solution.
Ctrl + Shift + L to select all occurrences of current selection.
As AsGoodAsItGets pointed out in one of the comments there is a feature request pending on VS Code github which will allow us to do that.
In the meantime I have a workaround:
Changes
and choose Open changed files
. Note that it will open also deleted files.Search
and select Search only in Open Editors
Not ideal, but that's how I search for my console.log leftovers ;)
Refer these screenshots. You can search in Open files easily.
Also you can use File to include feature
If you want to find all historical commits where commit message contains given word, use
$ git log --grep=word
If you want to find all commits where "word" was added or removed in the file contents (to be more exact: where number of occurences of "word" changed), i.e. search the commit contents, use so called 'pickaxe' search with
$ git log -Sword
In modern git there is also
$ git log -Gword
to look for differences whose added or removed line matches "word" (also commit contents).
Note that -G
by default accepts a regex, while -S
accepts a string, but can be modified to accept regexes using the --pickaxe-regex
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With