obsidian-switcher-plus icon indicating copy to clipboard operation
obsidian-switcher-plus copied to clipboard

Autocomplete filepaths

Open Kamuish opened this issue 2 years ago • 8 comments

Is there any way to autocomplete the filepaths with a given hotkey?

For example, something similar to what was requested in the official forums:

https://forum.obsidian.md/t/auto-complete-path-parts-from-quick-switcher/34135

Kamuish avatar Oct 03 '22 14:10 Kamuish

@Kamuish Thanks for the feature request. I'll take a look at that post.

darlal avatar Oct 08 '22 10:10 darlal

Is there any update on the status of this feature request?

Kamuish avatar May 17 '23 10:05 Kamuish

This is still in the backlog for possible future implementation, just haven't gotten to it yet.

darlal avatar May 20 '23 17:05 darlal

Someone wrote a PoC and published it here. It is by far not perfect – again poc – and I am not sure which it interferes with Quick Switcher++ .

Syphdias avatar May 25 '23 12:05 Syphdias

Thanks for the link! As far as I can tell that PoC just updates the search text prefix with the path from a specific user chosen suggestion. It doesn't seem to do what's being requested, the vault wide path completion using canonical path completion rules similar to a Linux shell. As is, I'm not sure how well it will work with Switcher++, but if it does part of work and it useful in your workflow then that's awesome 👍

darlal avatar May 28 '23 12:05 darlal

Thank you for the follow-up, @darlal and @Syphdias . @darlal I am failing to see how that differs from a (simple) tab completion, but I will try to test it out and report back!

Kamuish avatar May 30 '23 08:05 Kamuish

@darlal is right. The PoC is different than what the initial post suggested. There are multiple things different, but for example the PoC does no partial completion and just picks the next directory of the selected note or file. As an example you could have the note hay/stack/needle.md and you search for "needle" and press tab to get "hay" (deleting "needle"). This is sufficient enough for my uses but indeed not what was suggested. I might even want to get "hay/stack/" after pressing tab, but this is my use case.

The PoC might be close enough for what you are after, too, @Kamuish. I was only searching for similar functionality in different Switcher plugins and stumbled over this issue. Later I found the PoC code and found it useful and thought I would mention it here. But it is different, has bugs (switcher does not update file list), and cannot be installed easily through the community plugins. Which is why I would prefer a project to implement is properly but this takes work of course.

Syphdias avatar May 31 '23 12:05 Syphdias

Adding a hotkey to replace/insert the path of the currently highlighted suggestion into the Switcher textbox could be done, if that's would be helpful. A full implementation of path completion as described in the linked post likely won't be a near term item (though well-tested PRs are always welcomed!).

darlal avatar Jul 29 '23 18:07 darlal