Skip to content

Add a custom tree view to vscode to show files in virtual folders

Notifications You must be signed in to change notification settings

Gruntfuggly/virtual-folders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Folders

This was based on a feature request. It allows you to define virtual folders in a separate view. So if you're working on a C++ project, you can have headers and source files organised separately.

If no virtual folders are defined in your preferences, it will simply group files by their extension. If you want you can close the standard Open Editors view.

Pros:

  • keeps files organised
  • sorts files in alphabetical order

Cons:

  • doesn't show SCM status
  • no close button
  • doesn't show icons (at the moment)
  • doesn't show foldername for files which aren't directly in the current workspace (at the moment)

Installing

You can install the latest version of the extension via the Visual Studio Marketplace here.

Alternatively, open Visual Studio code, press Ctrl+P or Cmd+P and type:

> ext install virtual-folders

Source Code

The source code is available on GitHub here.

Configuration

The extension can be configured as follows:

virtual-folders.folders

Defines folder names with a list of globs to match files. E.g. for C++ you could use:

"virtual-folders.folders":[
    {
        "name": "Headers",
        "files": [
            "**/*.h"
        ]
    },
    {
        "name": "Source",
        "files": [
            "**/*.cpp"
        ]
    }
]

Known issues

Due to a vscode API limitation, files are only added to the view as they are opened. The downside of this is that when you reopen vscode, the view will be empty. As each file is visited, it will get added to the view.

Credits

Icon by Hopstarter

About

Add a custom tree view to vscode to show files in virtual folders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •