5

For example, I want to search a file whose name is "module-product.js" to rename it.

But there are lots of files whose names started with "module-".

How to quickly find the specific file in Visual Studio Code?

skyclouder
  • 419
  • 6
  • 25
  • 5
    ...You hit `Ctrl-P` (or `Command-P` on a Mac) and start typing `product.js`? – ChatterOne Oct 08 '18 at 10:29
  • Hi @ChatterOne, the method works! Could you add the answer below? I'll choose it as the useful answer. Thank you. – skyclouder Oct 09 '18 at 04:23
  • Duplicated question as: https://stackoverflow.com/questions/32648566/how-can-i-find-file-by-name-in-visual-studio-code – Jaime Jan 09 '19 at 15:15

2 Answers2

4

Ctrl+P and enter details into the popup that you would like to search for! You can prefix the search with # to search for a function.

Others (on a mac) include;

  • +T Show all Symbols
  • +G Go to Line...
  • +P Go to File...
  • ++O Go to Symbol...
RobC
  • 20,007
  • 20
  • 62
  • 73
Jeremy
  • 675
  • 8
  • 22
1

A secret feature of VSCode is the explorer filter.

Cmd-Shift-E (or clicking the sidebar) focusses the explorer. Typing some characters shows only files or directories whose names contain the given characters. Esc clears the search.

As usual, you can use Up- and Down-Arrow to navigate the displayed file list and Cmd-Down to open the currently highlighted file.

Denis Howe
  • 1,727
  • 19
  • 19