I installed vimtex using vundle. On opening any .tex file with vim, I get
Error detected while processing function vimtex#cache#wrap:
line 4:
E488: Trailing characters
E126: Missing :endfunction
My vimrc looks like
Plugin 'lervag/vimtex'
filetype plugin indent on
let g:tex_flavor = 'latex'
tex file
\documentclass{minimal}
\begin{document}
\section{Abstract}
Just an Abstract
\end{document}
Does anyone know how to solve the problem? Thank you
Which version of Vim are you on? Which OS/distribution?
I think I've fixed it, please test.
Thanks for the quick response and the fix. It works fine now.
I am currently using Vim 7.4 on ubuntu 16.04 if that is relevant now.
I would like to know what was the bug and how did you fix it?
Thanks for the quick response and the fix. It works fine now.
Great, happy to hear it!
I am currently using Vim 7.4 on ubuntu 16.04 if that is relevant now.
Sort of. You are using an old version of Vim that does not support the lambda feature, which also provides support for closures. I use this to make a cached version of a function for doing kpsewhich calls. These may be slow, so caching is useful to speed things up. You need patch level 2120 on Vim 7.4 (see :version to see which patch level you are on) for this support.
I would like to know what was the bug and how did you fix it?
I fixed this by disabling caching on old Vim. See here for the concrete changes.
Thanks. I have now updated my vim and patch level.