VSCode/How To/Find and Replace/Multiple Files
Properties
- type
- Diataxis/How To
How to use the keyboard to find replace across multiple files
- In this how-to guide, we will replace the string "
Today Day Link" with "Today Page Link(see Logseq/Template/Today/Link)" across multiple files using VSCode keyboard shortcuts. use the #VSCode #Keyshort to open the Find aka Search panel #card
use the #VSCode #Keyshort to open the replace details in the Find dialog, #card
- tab to the "Files to include" text entry and enter a wildcard path that matches the files to include
- tab to the "Files to exclude" text entry and enter a wildcard path that excludes files
- Tab to the "Pages" disclosure in the panel so it's highlighted.
- Press Down to focus on the heading of the pages section containing the result
- Press Down again to select the first page that contains results (this is a whole file of results, even though the image below only contains a single result for each file)
Apply changes to an entire File
Apply particular changes in a File
- At this point, no file will be open in the editor. If you press Down once to focus the Change Diff for the first Find and Replace Result for the File, the diff for the file will open in the editor. If there are multiple changes to make in the file, there will be one line for each change.
When focused on a particular Change Diff line in the Pages panel of the Find and Replace aka Search panel, what is the #VSCode #Keyshort to apply the selected Change? image.png #card
- In this how-to guide, we will replace the string "