Get relative path between 2 files

Hello jetbrains community,

I have a question the could be a feature request.  I have been working specifically in CLion, but any of the Jetbrains IDEs could potentially use this feature (assuming it doesn't already exist!).

When including c++ header files, I often find myself typing out paths like this:  #include "../../../Folder1/Folder2/Folder3/header_file.h"

It would be awesome if there was a way Clion could compute the relative path from one file to another.  While headers are specific to C++, I've often wanted this feature when working on web-apps as well.

Does this already exist in Jetbrains?  If not, it would be an awesome feature!

Cheers!

Hunt

0

Hi, Hunt! Could you please describe on some example how you would like this feature to work?

0
Avatar
Permanently deleted user

hello,

Well it would be great if you could rigth click the file which you want to know the relative path to.

Press get relative path of file from location.

Then a window open (like evaluate for instance) you enter the path (full path C:\ or /home/user....) of the file where you will call the relative path.

And as the evaluate window you get the relative path of the file. And you can modify the full path to get different result without leaving the window.

 

it would be awesome

 

0

 Hello,

I had the same wish and I tried to create a plugin.

You could try it with this link.

https://plugins.jetbrains.com/plugin/12396-relative-path-getter-hameelij

0

请先登录再写评论。