I have the following line in a file I\'m editing in VSCode:
...............111.........111.............111..
I want to replace all .
I was able to get it to work but the workflow is poor:
It works but you have to go through the workflow all over again for each new selection (except for CTR + H of course). BTW I have the exact same behavior in Sublime Text.
Could you go with a regExp to find your lines? Do they contain only .'s and 1's?
From the VSCode devs:
We used to enable find in selection automatically when opening the find widget with a selection, but it was too easy to trigger accidentally and produced a lot of complaints. You probably want to set "editor.find.autoFindInSelection": true which will make it work the way you expect.
The VSCode GitHub issue has more details if anyone is interested.
EDIT: The autoFindInSelection
option is available starting from VSCode 1.13. That version is currently in development (as of 6/7/2017), so this fix won't work until the new version is released.
This is a more general answer for other users who come here just wanting to use basic find and replace functionality.
On Mac you can press Command + Option + F to open Find and Replace:
Alternatively, you can press Command + F to open Find and then click the little triangle on the left to show the Replace field:
On Mac:
Since sometimes we might have similarly named things so you don't want to select everything, one of my favorites shortcut sequences is to select the next occurrence:
The Basic Editing in VS Code documentation page has some extremely useful variations on find and replace. One extremely useful shortcut is the Column (Box) Selection.
I found the following workflow to be fairly painless: