Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More full-featured matching for mapped_locations for paths #4929

Open
1 task done
miscoined opened this issue May 14, 2024 · 0 comments
Open
1 task done

More full-featured matching for mapped_locations for paths #4929

miscoined opened this issue May 14, 2024 · 0 comments
Assignees
Labels
🚀 feat New feature

Comments

@miscoined
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed/added?

I'd love to be able to specify regex, or some form of more complicated mapping for paths. I can see that this has been discussed previously in #688 and #187 and was abandoned because of side effects. I thought it might be worth asking what those side effects are, and whether there's a less-expansive variant feature here that might provide some additional functionality without those issues.

For my particular use-case, I specifically would love to be able to specify a regex for mapped locations, and I don't mind if that regex has to start at the start of the path. My specific use case is that I have a lot of directories which are basically different projects, with similar directory structures that are very deeply-nested. I have a separate command block which handles putting the project name at the start of my path, but I'd really like to not see the path to the project in my path, while also seeing a shortcut to those deeply-nested directories.

With the current capabilities, I have to repeat every shortcut mapping for each project, which looks something like this:

mapped_locations:
  "/my/projects/dir": ""
  "/my/projects/dir/project1/some/deeply/nested/dir": "🧪 "
  "/my/projects/dir/project2/some/deeply/nested/dir": "🧪 "
  "/my/projects/dir/project1/some/other/deeply/nested/dir": "☕ "
  "/my/projects/dir/project2/some/other/deeply/nested/dir": "☕ "

I'd love to instead do something like this:

mapped_locations:
  "/my/projects/dir": ""
  "/my/projects/dir/(.*)/some/deeply/nested/dir": "🧪 "
  "/my/projects/dir/(.*)/some/other/deeply/nested/dir": "☕ "

Whether it uses regex or a set wildcard mapping doesn't matter to me. I'd be equally happy with:

mapped_locations:
  "/my/projects/dir": ""
  "/my/projects/dir/*/some/deeply/nested/dir": "🧪 "
  "/my/projects/dir/*/some/other/deeply/nested/dir": "☕ "

Without this, as far as I'm aware the only workaround is to either do it manually as I've been doing so far for the projects I use most, or to use a command block which basically re-implements the path block with this functionality.

Thank you for working on this excellent utility :) I've bounced around a lot of these and this is the first one non-DIY option that I've stuck with for any length of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feat New feature
Projects
None yet
Development

No branches or pull requests

2 participants