EditorGroups
EditorGroups copied to clipboard
Group by same file name in custom group
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.
similar to #5 #21
You could do something like that globally now (https://github.com/krasa/EditorGroups/issues/21#issuecomment-675001264) with (.*)\..*