hrsh7th / vim-vsnip

Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to expand LaTeX snippets

tani opened this issue · comments

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.

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

I see thanks.