Feature Request: Add an easy way to supply two different file paths as parameters #378
Replies: 1 comment 2 replies
-
Hi! Thank you for your suggestion and kind feedback! 🙂 I do agree that it's unfortunately limiting that the plugin does not currently provide a way to retrieve properties from all the open files.
Hmm, yeah, it could make sense to be able to access files to the left or right of the currently focused file. I'd need to figure out the syntax for it. It can get quite complex, as Obsidian is very flexible by its user interface:
So, how to come up with a syntax that could allow different scenarios? For example:
Variable scopingThere should be some kind of scoping mechanism: The normal variable Also, to support a dynamic amount of tabs, there could be a scope that could provide access to multiple files at once: I've been thinking about the ability to access multiple files every now and then, but haven't yet come up with a clear plan for it. I'll keep thinking about it, perhaps it will clear up to me some day. One workaround for nowWhat you can do currently, is that you can use the File menu event to have your shell command appear in the menu if you right click on a file. Then, in your shell command you can use {{event_file_path}} to get the right clicked file's path, and {{file_path}} to get the currently focused file's path (= the one which has a caret). These can be two different files. I hope this provided some help to the situation. 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
I want do diff two files from my vault using VSCode and therefore use the plugin to run
code --diff <file 1 absolute path> <file 1 absolute path>
.This works excellently but with the small downside that I can only read one file path automatically, currently using
{{file_path:absolute}}
- as far as I know, please tell me if there is a more convenient way. The other parameter is supplied using a custom variable for which I have to paste the second file path by hand, which in turn requires leaving obsidian and thus defeats the whole purpose of automating the diff in the first place.Request
I would love for the plugin to be able to automatically read two paths from within Obsidian to spare me the hustle of changing applications manually.
Suggestions
The greatest but probably most specific addition would be the ability to right click a file and store the absolute path to a variable. I don't know how many use cases there are for others though.
Another great alternative would be, if the plugin was able to read the path other files that are opened 'to the right', maybe using an index. In this scenario, I would open the two files to diff side by side, run the shell command, which takes the first two panes opened next to each other and VSCode would open the diff of those files.
Thanks
This plugin is amazing and saves me tons of time. Thank you very much for developing such a powerful and easy to use tool!
Beta Was this translation helpful? Give feedback.
All reactions