Sublime Forum

Link to open ST file and ST project together

#1

I’m using ST 4 on Linux, and I’m a writer not a programmer. I organize my writing as markdown files within various ST projects. As an example, I’ll have one ST project named ESSAYS and another named ARTICLES.

To help with my organization, I’m also using a spreadsheet (Libreoffice).

The functionality I’m asking about today is this: I would like to be able to click a link within Libreoffice to take me to a specific ST file, but I’d like it to open that file within its ST project–i.e., I’d like to have the ST project opened and the specific file opened as well.

So, for example: I click link in Libreoffice to FILE1.md, which is part of my ESSAYS project. That click then opens both the ESSAYS project in ST and FILE1.md within it.

If this is merely a Libreoffice affair, forget I mentioned it. But if there’s a flag somewhere in ST that knows FILE1.md belongs to the ESSAYS ST project and can open both when FILE1 is summoned, I’d like to know about it.

THANKS

0 Likes

#2

The thing that associates a file with a project is the fact that the sublime-project (or sublime-workspace, if you’re not using explicit projects) has a list of folders that it contains, and said file appears wihtin one of those folders on the drive.

Or if you will, the way you would be able to tell if a file exists in a project is to examine the file system to see if the directory of the file or one of its parent folders contains a sublime-project file, and then either assume that it’s related to the file, or examine its contents.

There’s nothing that does that specifically; you would have to implement a script of some sort.

Such a script can trigger the subl command to open a project, and then it could attempt to open the file within that project (also by using subl).

0 Likes

#3

Thanks for the info, OdatNurd. It definitely sounds like something I don’t need to fool with. I can certainly live without it. I appreciate your time.

0 Likes