miniSnip icon indicating copy to clipboard operation
miniSnip copied to clipboard

Expansion without file snippet

Open akemrir opened this issue 2 years ago • 2 comments

Hi is it possible to expand without file snippet?

When I would have separate source of completion, omnicomplete for example:

Scenario: Breaker guesses a word
  Given the Maker has chosen a word
  When the Breaker makes a guess
  When the <{}> makes a guess (c)
  Then the Maker is asked to score

(c) - where cursor is placed after line insert.

I want to jump to placeholder and fill it in as in snippet from file.

akemrir avatar Mar 20 '23 06:03 akemrir

At the moment, it's not possible, I'm afraid. I was experimenting with something like that, but deemed it not worth the effort at the time.

On the other hand, it's not impossible. It's a matter of creating s:SNIP dictionary (with s:Snip() function), then adding s:SNIP.patterns with s:updatePattern(), then filling s:SNIP.pos (which normally would happen in s:insertSnippet()) and handling this case in miniSnip#trigger(). I think I would welcome a PR for that.

Jorenar avatar Mar 21 '23 17:03 Jorenar

ok, will do the POC when I got time

akemrir avatar Mar 25 '23 15:03 akemrir