Fuzzy file opening in VS Code including workspace-external files
Asked Answered
M

3

17

I am exploring vscode after using atom for a long while. One of the things I'm missing is an equivalent of the lovely package advanced-open-file. Is there something similar to this in VS Code?

I found the advanced-new-file extension, but it is only helpful when it comes to new files. I would like to be able to quickly open files from all over my local files (not only the workspace).

Edit: I found the option of workbench.action.quickOpen; but it doesn't allow opening files from the whole file system.

Mikes answered 19/3, 2018 at 19:49 Comment(2)
Somewhat related: #43505 & #44961Spokeswoman
What does VSCode offered to you that Atom didn't? I've used VSCode for only a few days and never used Atom. I noticed the two are related though: both run on ElectronJS, both market themselves as highly customisable power-editors for coders. Noticing that Atom was developed at GitHub and Microsoft bought GitHub I'm wondering whether VSCode tries to be a better Atom. Is it? How?Olen
H
6

Sorry, but currently the answer is no. The problem is that input box doesn't provide a way to listen to key events: GitHub issue, so even the extensions can't do that currently. Here's the comment from advanced-new-file extension creator:

Because VSCode extensions don't yet have the ability to do type-ahead autocomplete within the text input box (See https://github.com/Microsoft/vscode/issues/426), we work around this limitation and provide autocomplete using a two-step workflow of selecting existing path, then providing new filename/path relative to the selection.

The good news is that there is a new API addressing this issue, but it's currently in 'proposed' state and can't be used for published extensions.

One workaround could be typing code -r some/path in integrated terminal and using 'tab' for autocomplete.

Hopkins answered 3/7, 2018 at 14:18 Comment(0)
E
2

Quick Open supports fuzzy searching, but as you said, doesn't support files outside the workspace unless they were opened before in that workspace and remembered as "recent files".

The file/folder opening commands like File: Open File... support switching to a VS Code builtin interface via the files.simpleDialog.enable setting, which enables selecting files outside the current workspace, and provides suggestions for completions, but currently doesn't support fuzzy search, though there is a feature-request asking for it to: Fuzzy Search in Open File/Open Folder simple dialogs #202367. I suggest that you give that issue ticket a thumbs up to show support for it. You can also subscribe to it to get notified about discussion and progress. Please avoid making noisy comments there like ones that just consist of "+1" / "bump".

So no, I don't think there's a way to get what you want at least without installing an extension. There probably is an extension out there that does this, but I haven't tried any of them. You can search the extension marketplace for fuzzy file openers.

Engineer answered 19/1, 2024 at 19:11 Comment(0)
C
1

The Fuzzy search extension seems to work for me.

It adds a new action to the command palette which allows you to search for files in the current project and open them.

Cene answered 13/6, 2022 at 7:9 Comment(1)
this question is also wanting to include files outside the workspace.Engineer

© 2022 - 2025 — McMap. All rights reserved.