RyotaUshio / obsidian-pdf-plus

The most Obsidian-native PDF annotation, viewing & editing tool ever. Comes with optional Vim keybindings.
https://ryotaushio.github.io/obsidian-pdf-plus/
MIT License
466 stars 11 forks source link

[FR] "Jump To" Vim Option #218

Open julroger2013 opened 3 weeks ago

julroger2013 commented 3 weeks ago

Describe your request

Thanks for making this excellent plugin.

I'm enjoying the Vim Mode very much for navigating my PDFs. It gets me very close to having a totally mouseless workflow on my PDFs.

The option of searching for a word and then selecting it to enter visual mode is helpful. However, I'm wondering if you could implement a "Jump To" shortcut that would allow leaping to any visible word by typing in a two-character combo marking each word based on Regex.

There's a plugin that implements this in Obsidian's main edit - Jump To Link - and it's a nice way to instantly jump to a particular word, even if that same word is present in other spots on the page. I think I similar shortcut would be valuable for PDF++. One shortcut to cause the two-character combinations to appear on-screen, and then typing in the two characters to leap to that spot. I included a screenshot below to show what I mean.

image

Finally, would it be possible to make it so that text selection mode in Vim can move more than one character at a time? It would be great to select text word by word, although I wonder if that would be more difficult to implement in a PDF than in a text editor ...

Thanks again for all of this!

RyotaUshio commented 3 weeks ago

Thanks, I'm glad you're enjoying the vim mode!

Jump To

I've already implemented something similar for links and highlights as "hint mode".

From the PDF++ settings:

image

Example:

https://github.com/RyotaUshio/obsidian-pdf-plus/assets/72342591/c0dff798-e007-411d-b50b-698b4ed20125

So do you want the same functionality to also work for every word, not limited to links and annotations?

would it be possible to make it so that text selection mode in Vim can move more than one character at a time? It would be great to select text word by word

Word-level motions (w/e/b) are already supported as explained in the setting:

image

You can also combine numbers with these motions for modify the selection more efficiently, like 5j, 3e

julroger2013 commented 3 weeks ago

Oh yup, jumping a word at a time works just fine. I just didn't know the hotkey for it.

Yes, I think the Jump to Any word function would be helpful for this!

julroger2013 commented 3 weeks ago

Sorry, an additional thought. Of the two options presented by the "Jump to Link" plugin, I think the Lightspeed option is the better of the two.

The "Jump to Anywhere" feature kicks in for any word of 3 characters or greater, which generates lots of visual clutter.

Lightspeed mode, by contrast, allows you to type the first two letters of the desired word before applying visual tags to only those words that begin with those two letters. This generates far fewer two-key combinations to choose among, which is more streamlined in my view.