-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secondary search #118128
Comments
Do you want to search in the line with the match, and the surrounding lines, or anywhere in the file? If the first, try Search Editors. |
Anywhere in the file |
It would've saved me so much time to have this capability on 3 unique occasions today. Talked w @kieferrm and I hope to work on a PR for ripgrep in the coming iterations so that we have a: SearchTerm1 && SearchTerm2 option |
Could also be a good extension candidate using the (proposed) For your original case, it sounds like what I often use "files to include" for, when I want to search for the use of a term like ipad in some feature area like notebooks, I would use |
I made an extension which applies a workaround by copying the current search results, regex-ing for the filenames, getting their relative paths and then putting those paths into the 'files to include` filter. Find and Transform. Specifically Using the Search Results files in another search. Use from the context menu, Command Palette or a keybinding like: {
"key": "alt+shift+f",
"command": "runInSearchPanel",
"args": {
"find": "Second", // plus all the other args from the findInFiles command
"replace": "Third",
"filesToInclude": "${resultsFiles}", // !!
"triggerSearch": true
},
"when": "hasSearchResult" // I suggest this but it isn't mandatory
} There are other ways to use the Using this keybinding: {
"key": "alt+z",
"command": "runInSearchPanel",
"args": {
"filesToInclude": "${resultsFiles}",
"triggerSearch": true,
}
}, Demo: [Since the context menu item for this really belongs in the Search results context menu but that is not currently exposed to extensions, I am going to file an issue requesting it. See https://github.com//issues/127896] |
This is a duplicate of #197634 /duplicate |
@osortega I disagree about this being a duplicate. That one is about tree filtering. And anyway it's locked so unavailable for discussion. |
I'd like to be able to search for something, for example
ipad
and then in the files which contain that term, search for something else, for exampleterminal
.IE find files which contain ____ && ____.
The text was updated successfully, but these errors were encountered: