neoclide / coc-vimtex

vimtex integration for coc.nvim
130 stars 4 forks source link

Add a feature to add N braces for the number of arguments when completing a command #4

Open juliankrieger opened 5 years ago

juliankrieger commented 5 years ago

Latex commands are defined like this \newcommand{\newcommandname}[Number of Arguments]

Is it possible to add a variable number of braces when completing a command, for example make \begin complete to \begin{}, and make the braces "jumpable" like with snippet plugins?

I would be willing to look into it, but I'd love a suggestion on where to start.

chemzqm commented 5 years ago

Yes, you just need to generate snippet according to current user input, just like what https://github.com/neoclide/coc-emmet does.

p135246 commented 4 years ago

Hi, are there any news? I would be also very much interested in this sort of auto-expansion. Unfortunately, I do not know the internal mechanisms of coc and vimtex and can not do it other than by defining a new snippet for every LaTeX command...