In VSCode how can you "replace in files" without opening every single file to save?

Viewed 1010

When I use "find in files" to replace many instances of a string - Visual Studio Code opens every single file for me to save and close. This becomes unwieldy when the amount of files is greater than 10. Is there a way to make vs code just replace, no questions asked?

2 Answers

There was a feature request for this problem last year as you can see in here https://github.com/Microsoft/vscode/issues/14554. But, I don't think this feature has been processed or added yet.

The most closest way that you could do is to activate the files.autosave feature into afterDelay and set the files.autoSaveDelay under 1000ms.

Alternatively, you could try to use unix/linux command like sed.

Ctrl+Alt+Enter will replace all the matches in all the files (a pop up asking you to confirm will appear)

Related