EditorGroups icon indicating copy to clipboard operation
EditorGroups copied to clipboard

Group by same file name in custom group

Open mdeboer opened this issue 4 years ago • 1 comments

Currently there is no way (as far as I know) to define your own group that matches files from one directory to files in another directory but only if they have the same filename. You can only match using a regex which when using a wildcard lists all files that match the regex, also the ones that don't match (part of) the current file name.

Example

+ layout | - header.html | - body.html + scss | - header.scss | - body.scss + docs | - header.md | - body.md

Just a random example from the top of my head to demonstrate. I would like to match files from layout to files in scss only. If I use the same file name group, It also groups files from the docs directory, which are unrelated.

Proposal

FILENAME Macro

Introduce a FILENAME macro that is replaced by the current file name without the extension. This would allow for a syntax like:

@group.id layout
@group.related layout/FILENAME.html
@group.related scss/FILENAME.scss

Or when placed in layout for example:

@group.id layout
@group.related ../scss/FILENAME.scss

If I'm correct, this would do what I want.

mdeboer avatar Apr 01 '20 23:04 mdeboer

similar to #5 #21 You could do something like that globally now (https://github.com/krasa/EditorGroups/issues/21#issuecomment-675001264) with (.*)\..* image

krasa avatar Aug 17 '20 17:08 krasa