Closed akemrir closed 2 years ago
Huh, that's interesting. Under what name is the snippet saved at?
Because array.sel<expand>
should result in message miniSnip: no snippet with that name
and not expand at all.
Yes, it should. But with my change in PR it resolves after dot. When I update accordingly to your comments, I'll get back here.
Ok, so I've updated the PR and here is minimal vimrc https://gist.github.com/akemrir/17e27ee30adbf45ae364fb2c39be6a06
It works somewhat, but I need to test more. The purpose is to expand words even with - or _ with a-zA-Z0-9 It should grab snippet key after dot and other symbols.
For example } =
I've checked this, but it grabs too much for me. :help \f
I need to build up docs also.
OK, going back to the example, if I understand correctly, you have a snippet file sel.snip
, yes?
And you want array.sel<expand>
to become array.select { |<{element}>| <{+}> }
, do I get it right?
Yes.
Something like that. But I need to check why sometimes it goes back to completion. https://user-images.githubusercontent.com/240986/182774017-5a097e03-e026-42b0-b512-0b54ec731629.mp4
Ok, found it. Addon works fine. My configuration was the cause. I was using this:
Which was set to:
set whichwrap+=h,l,<,>,[,],b,s,~
[ and ] was the problem, when I removed them snippet expansion went back to normal. I reverted it to vims default.
But I've found different problem. I will investigate it. Sometimes I need to hit expand two times to get it really expanded. And sometimes it omit expansion and jumps to next position.
https://user-images.githubusercontent.com/240986/183298884-4882e314-d976-4a51-93f7-86cca7d4f1ea.mp4
The mentioned PR is a nice feature, which I definitely want to merge into the plugin, but it's not a solution to this issue.
The default pattern is indeed not correct and needs to be changed.
I agree. This issue and PR are different topics.
Hi I have prepared pull request #23
My vim details: VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 16:22:51) / ArchLinux
But at the moment I have problems with expanding in ruby code. It consumes dot. For example:
With following snippet:
Sample code
Result
And sometimes it does not expand at first time. I am using ddc to support complete menu.
Other settings