Reputation: 2781
Env
Ubuntu 16.04
Visual Studio Code v 1.2.1
Problem
I can search occurrences in all files by Ctrl + Shift + F
However, I can't find a way to search and replace occurrences in all files.
Is this a missing(or hidden) feature in Visual Studio Code.
Upvotes: 38
Views: 80918
Reputation: 442
All File:
Search = Ctrl + Shift + F
Replace = Ctrl + Shift + H
One File:
Search = Ctrl + F
Replace = Ctrl + H
Upvotes: 0
Reputation: 1324278
As an enhancement, VSCode 1.70 supports search and replace in all selected files, solving the 2018 issue 47166 "Make search tree context menu multiselect-aware".
See PR 154847 (available today in VSCode insiders)
Make search tree context menu multiselect-aware
When multiple entries are selected, if someone removes/replaces on one selected item, it happens to everything.
Note: if a whole file (uses
Replace All
) and entry (just usesReplace
) are both selected at once and eitherReplace
orReplace All
is used, whatever replace action is valid for all selected item will run.For example, if a file and entry are all selected and the
Replace
button is selected on theentry
, thenReplace All
will be run on the file andReplace
will be run on the entry.
Example:
Upvotes: 1
Reputation: 8091
VS Code also supports capturing groups when using regex, captured groups (using parenthesis) can be referenced with $1
for the first match, $2
the second etc. $0
returns the complete match.
Upvotes: 11
Reputation: 2781
Visual Studio Code v 1.3.0++ has this feature:
Replace functionality can be accessed:
Upvotes: 52
Reputation: 45243
It's currently not possible to replace in all files. The good news is it's part of the June Iteration Plan. The feature has already passed a couple of tests. So it will be probably released in July 2016.
Upvotes: 3