Search code examples
visual-studio-code

How do I share the search pattern across VS Code windows?


VS Code: 1.23.1
OS: OSX 10.12.6

If I have two different VS Code windows/instances open- each of which could have multiple tabs, and could also be workspaces- and I run Find... in one window, the search text and settings (e.g. Match Case, Match Whole Word) in the other window are unaffected. I'd like to find a way so that these are always linked, they're always kept in sync. How can I get this?


Solution

  • This is possible, but not the default behavior of VSCode.

    Go into Settings, search for find clipboard, and you'll find two checkboxes:

    • Editor > Find: Global Find Clipboard
    • Search: Global Find Clipboard

    Check both of these boxes, and now all the Search boxes across all your VSCode windows/tiles/tabs/file searches will share the same search buffer across your entire computer (on Mac, at least), just as we expect.

    Why these two boxes aren't checked by default is anyone's guess.