mohkale / consult-yasnippet

Other
35 stars 3 forks source link

how do users normally call this? #7

Closed titaniumbones closed 2 years ago

titaniumbones commented 2 years ago

Is the expectation that consult-yasnippet is bound to it own key, or that TAB can somehow be bound to some other function that defaults to calling consult-yasnippet when other actions don't make sense?

I'm just trying to figure out how best to use this cool-looking tool.

mohkale commented 2 years ago

I expect users to do what they prefer :-). Of course you can bind it to a key in yasnippet-mode-map or you can always call it through M-x consult-yasnippet. The best approach is almost always the approach you decide you prefer.

Personally I have C-i bound to expand a snippet (example def<C-i> expands the def snippet) and C-M-i bound to consult-yasnippet. I don't see much value in using consult-yasnippet when I can much more quickly get to what I'm trying by using yas-expand. consult-yasnippet is more useful for those situations where you don't remember what a snippets shortkey is (or if it doesn't have one). That way you can use the completing-read interface to explore a bunch of different snippets and help you discover it's abbreviation so you can later access it without consult-yasnippet.

Of course you can disagree with this approach, or come up with your own. It's all a matter of personal preference.