norcalli / snippets.nvim

GNU General Public License v3.0
277 stars 13 forks source link

Feature request - "regular" inserter #26

Open ranjithshegde opened 3 years ago

ranjithshegde commented 3 years ago

When using snippets.nvim to expand/complete LSP snippets, it would be helpful to have autocomplete, further snippets and other features related to the current buffer where the snip was called from. This is not possible of course when using floaty ux inserter or vim input inserter as they are not expanded in the current buffer.

So the feature is, could there be a possibility of and an inserter for expanding the snippets in the current buffer, much like UltiSnips/vim-vsnip etc?

clason commented 3 years ago

There's the text_markers inserter -- it's not pretty (using literal markers instead of extmarks, which were not available at the time this was written), but it works.

ranjithshegde commented 3 years ago

Thank you for your response. I did try text_markers after creating this issue, but like you said, its a bit not easy on the eyes and at times can confuse you. But yes it does work for the purposes I had in mind.

Are there plans to implement the exmarks for this inserter method in the future? I understand that everyone is busy with 0.5 release

clason commented 3 years ago

The extmarks functionality in neovim should already be implemented (although there are still a few rough spots to polish, which may be relevant here). The corresponding inserter needs to be written (should be a relatively straightforward modification of text_markers.lua).

I believe @norcalli has pretty much abandoned this plugin (which is a pity, because at least for me it's still the best Lua snippet engine out there), so somebody else needs to write it and probably distribute it as a separate plugin.

trv6 commented 3 years ago

I made an attempt at this. https://gist.github.com/trv6/353031dfb9b86f83e5318b93a2a2efb8

clason commented 3 years ago

And, because the universe loves symmetry, someone just requested a "floaty inserter" for LuaSnip ;)

gpanders commented 3 years ago

I just opened ~#31~ #32. I guess this plugin is not maintained anymore so I don't know if it will be merged, but you are welcome to try my fork if you want.