mohkale / consult-yasnippet

Other
35 stars 3 forks source link

Support for partial completion? #8

Closed memestreak closed 2 years ago

memestreak commented 2 years ago

Hi! Is it possible or planned to support partial completion in M-x consult-yasnippet?

I'd like to enter part of a snippet key "tod" and have M-x consult-yasnippet show me alternatives for snippets that start with "tod" (pre-filling the minibuffer with what I've already typed).

Thanks!

mohkale commented 2 years ago

Definitely possible. You can get the identifier at point using word-at-point. You'll have to amend consult-yasnippet with a new optional argument that contains the word-at-point, then you can pass it :initial for consult--read.

PRs are welcome, although if you do implement this please also add an option to disable this behaviour (personally don't think I'll like it).

mohkale commented 2 years ago

Thanks to @furkanusta this has now been added as an optional feature.