Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

Allow regexp capture group in snippet. #426

Closed plexigras closed 6 years ago

plexigras commented 6 years ago
snippet    .map
options     word
regexp     '\(\w\+\)s\.map$'
  .map(\0 => ${0})

so i can have things.map convert to things.map(thing => ...)

and if the whole match would be removed by default you could do even cooler things

snippet    .keys
options     word
regexp     '\(\w\+\)\.keys$'
  Object.keys(\0)

then this would convert test.keys to Object.keys(test)

Shougo commented 6 years ago

Sorry, I don't want to add the complex feature in neosnippet.vim.