dawsbot / RelativePath

VSCode Relative path plugin
https://marketplace.visualstudio.com/items?itemName=jakob101.RelativePath
MIT License
69 stars 22 forks source link

Add option to omit specific string #25

Closed ColCh closed 6 years ago

ColCh commented 6 years ago

Example: I have file src/foo/index.ts And I want to get relative path for it from src/bar.ts I want to get relative path like ./foo

In this case, /index.ts is omitted

So, this extension is amazing and I'm mind to open Pull Request for this feature.

But I need to discuss usage and api for it.

May be make it array of regs?

kinda

given config.omit = [ /\/index.ts$/ ], and relative path src/foo/index.ts regexp in omit config will match string: /index.ts. And so I will just remove it from resulting relative path. Result will be src/foo

What do you think @jakob101 ?

jakob101 commented 6 years ago

Sounds great! :) feel free to post a PR