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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: open on current line #520

Closed
anuramat opened this issue Mar 27, 2024 · 1 comment
Closed

Feature request: open on current line #520

anuramat opened this issue Mar 27, 2024 · 1 comment

Comments

@anuramat
Copy link

馃殌 The feature, motivation and pitch

New function/command: in Obsidian app, open current file and scroll down to the current line

Motivation: I'm doing math notes in obsidian, and I usually have two windows side by side: Neovim to write, and Obsidian to preview the rendered output. With this feature, I won't ever have to touch the obsidian app window to scroll down to the currently edited line. The rough equivalent of this for actual LaTeX is called SyncTeX.

Alternatives

No response

Additional context

No response

@XiaowenHu96
Copy link
Contributor

This sounds like you're looking for a search functionality similar to SyncTeX.
This would require the viewer (in this case, the Obsidian app) to support some kind of protocol for remote control, allowing an editor (such as Neovim) to send commands to it. As far as I know, Obsidian currently does not support this feature directly. The closest feature available is the official Obsidian URI protocol, which, unfortunately, does not support jumping to an arbitrary line.

In terms of community plugins, there are options like Advanced URI and Obsidian Local REST API. However, it's uncertain to what extent the maintainers are willing to add features that rely on third-party plugins.

I would actually recommend you set it up on your own. The advanced URI plugin does support jumping to a specific line in a file. Then all you need to do is to figure out the current position through nvim_win_get_cursor and then issue a command xdg-open <URL> from neovim (assuming Linux).

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

No branches or pull requests

2 participants