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?

skyline
  • 443
  • 9
  • 31
  • 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. – skyline 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
  • 22,977
  • 20
  • 73
  • 80
Jeremy
  • 1,170
  • 9
  • 26
2

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.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Denis Howe
  • 2,092
  • 1
  • 23
  • 25