0

In my VS Code workspace I want to open a file by its name.

For example my workspace is a directory with has a few directories with each, say, a couple of hundred files and I look for a file with the name:

mycompanyname_abc_def.hs 

Many files start with mycompanyname but only this file contains abc in its filename. So preferably I'd like to find the file by just typing abc.

I know about Ctrl-P and Ctrl-R. They find the file if I have opened it before or if the file is in the workspace's top folder, but is there a command like Ctrl-P that finds any file in the workspace even if it is in a subfolder?

If VS Code doesn't have this out of the box, do any extensions exist providing this type of search/opening behaviour?


PS: Of course there is the normal system open dialog via Ctrl-O, but in my case (Barebone RHEL Linux) the Open Dialog does not provide any search functionality, only "select by click".

1 Answer 1

2

You can use ctrl-P - go to file - and type a part of the filename. Note that I don't find this excludes files that I haven't opened before - all files in my workspace are searchable.

For instance, if your file name is mycompanyname_abc_def.hs then abc or myabc should both work.

I am trying out the new (?) command center features as of version 1.73 and that is a good way to discover these types of navigation/search features: v1_73#_command-center-mode-shortcuts

Sign up to request clarification or add additional context in comments.

2 Comments

This definitely doesn't work for me. However, I checked the structure of my workspace and the file I look for is in a sub folder. I have adjusted the question accordingly.
Hmmm, not sure. Files in subfolders are searchable with ctrl-p for me.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.