fabiospampinato / vscode-open-multiple-files

Open all files in a folder at once, optionally filtering by a glob.
MIT License
11 stars 2 forks source link

Favorites globs list #4

Open usernamehw opened 5 years ago

usernamehw commented 5 years ago

Something like that defined in settings.json:

"openMultipleFiles.savedGlobs": [{
    "name": "All ts",
        "command": "all-ts",
    "glob": "**/*.ts"
}]

To be able to invoke it from Command Palette or a keybinding.

fabiospampinato commented 5 years ago

I see 2 features here:

  1. The ability to pass a glob to the openMultipleFiles.open command.
  2. The ability to save some "Favorites" globs.

Both make sense to me, I'll be happy to consider a PR for them.

fabiospampinato commented 5 years ago

The ability to pass a glob to the openMultipleFiles.open command.

I just implemented this, it's pretty cool. Just define a shortcut like this example one:

{ 
  "key": "cmd+k cmd+o", 
  "command": "openMultipleFiles.open", 
  "args": "**/*.md"
}
chrisbraddock commented 1 year ago

Similarly, would it be possible to apply the idea as filters to the >Open Multiple Files quick search item?

Maybe defined filters show as "sub-items" like: >Open Multiple Files: Angular Component.

"openMultipleFiles.savedFilters": [{
    "name": "Angular Component",
    "command": "angular-component",
    "filters": [
         {
            /** @description optional regex to test opened files against for inclusion */
            /* include: //, */
            /** @description optional regex to test opened files against for exclusion  */
            exclude: /(?:\.spec\.ts|\.spec\.ts\.snap)/ // do not open test or test snapshot files
         }
    ]
}]