0

I have lua neovim config here. I wrote some latex snippets in luasnip; for example the snippet that makes a new environment is triggered by begin to produce

s({
    trig = "begin",
    name = [[\begin{}]],
    desc = "Begin new environment",
  },fmt([[ 
    \begin{<env>}
        <con>
    \end{<env>}
    ]], {
        env = i(1, "environment"),
        con = i(2, "contents"),
    }, {
        delimiters = "<>",
        repeat_duplicates = true,
    })),

I have nvim-cmp as the completion engine and cmp-vimtex as completion source for latex files. When I use that snippet I get:

enter image description here

I press enter to begin snippet editing and enter itemize

enter image description here

then I press enter to accept the suggestion and tab to move to next snippet placeholder and get double closing braces:

enter image description here

I have read the vimtex and cmp-vimtex docs, and could not find the solution. How to make cmp-vimtex complete environments without extra brace?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.