VS Code Find and Replace Keyboard Shortcut

This article provides the exact keyboard shortcuts for finding and replacing text within a single file in Visual Studio Code (VS Code). You will learn the specific key combinations for Windows, Linux, and macOS, as well as a quick guide on how to use the find and replace interface efficiently.

The Keyboard Shortcuts

To quickly open the Find and Replace widget within your active file, use the following keyboard shortcuts:

Note: If you already have the standard Find widget open (via Ctrl + F or Cmd + F), you can toggle the replace field by clicking the small chevron arrow on the left side of the search bar.

How to Use Find and Replace in a File

Once the widget appears in the top-right corner of your editor, you will see two main text fields:

  1. Find Field (Top): Type the text you want to locate.
  2. Replace Field (Bottom): Type the new text you want to insert.

Executing the Replacement

You can use the buttons on the right side of the widget or use these keyboard shortcuts to apply your changes:

Search Modifiers

To refine your search, you can toggle three options located on the right side of the “Find” input box: