hrsh7th / vim-vsnip

Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
MIT License
876 stars 37 forks source link

Failed to expand LaTeX snippets #229

Closed tani closed 2 years ago

tani commented 2 years ago

Hi, thank you for the awesome project.

I report the issue and do not request to fix this issue because it seems that impossible to fix it. If you would not mind adding a disclaimer in README, I suggest mentioning this issue in your document.

The following snippet uses a complex regular expression to run the conditional expansion.

https://github.com/rafamadriz/friendly-snippets/blob/1614c0a1fb29aaf4762ce43c594cb33963650af1/snippets/latex/latex-snippets.json#L338-L346

  "\\begin{}…\\end{}": {
    "prefix": "begin",
    "body": [
      "\\\\begin{${1:env}}",
      "\t${1/(enumerate|itemize|list)|(description)|.*/(?1:\\item )(?2:\\item)/}$0",
      "\\\\end{${1:env}}"
    ],
    "description": "Begin - End"
  },

I expected the expansion should be the same as the VSCode's one, but not. Please feel free to close this issue if you have already known that.

Thanks.

hrsh7th commented 2 years ago

Currently, vim-vsnip does not support regex. See #83

tani commented 2 years ago

I see thanks.