garymjr / nvim-snippets

Snippet support using native neovim snippets
MIT License
215 stars 13 forks source link

Automatic expansion of snippets #6

Closed jolars closed 3 months ago

jolars commented 3 months ago

It would be nice if there was support for automatic expansion/triggering of snippets, so that if I have a snippet mapped to "ii" for instance, simply typing ii would expand the snippet. LuaSnip (https://github.com/L3MON4D3/LuaSnip) has support for this by writing the snippet like this:

{
  "Say hello to the world": {
    "prefix": ["ii"],
    "body": "Hello, ${1:world}!$0",
    "luasnip": {
      "autotrigger": true
    }
  }
}

Maybe this is something that needs to be part of the upstream support for snippets in neovim. Sorry for the noise in that case.

garymjr commented 3 months ago

I don't think this is something I currently want to support. I may circle back around on this at some point, but for now my main goal with this plugin is to support custom snippets with vim.snippet. Thanks for the suggestion though!