On Fri, 21 May 2021, Nicola wrote:
On 2021-05-21, Nicola
wrote: For some reason, the vim module has stopped highlighting code associated to custom filetypes (it still works for built-in filetypes).
I think I have found the culprit. In t-vim.tex, lines 63-88, Vim is called with --clean. That option appears *after* -u, effectively overriding it. Moving --clean as the first option (or, better, removing it) solves my issue.
Some remarks. The module has this comment:
--clean % dont load scada [sic] file (nvim)
If the purpose of the option is to avoid loading a shada file, `-i NONE` (which is already there) should be enough.
Thanks for finding the bug.
In Vim, --clean is not strictly necessary, because it is effectively a shorthard for `-N -i NONE --noplugin`. > In Neovim, the meaning might be slightly different. Which brings me to the next paragraph.
Indeed, the vim manpage says:
--clean Do not use any personal configuration (vimrc, plugins, etc.).
Useful to see if a problem reproduces with a clean Vim setup.
while nvim manpage says:
--clean Skip loading plugins and shada (viminfo) file.
So, in vim, the --clean option also skips vimrc while in nvim it does not.
Looking at my git log, I see that I added --clean option for nvim:
commit b907543d9f6b2185185f3674035987f47bf91381
Author: Aditya Mahajan
My recommendation would be not to care about Neovim. It is *not* a drop-in replacement for Vim and not meant to be compatible with Vim (it has already diverged from Vim in significant ways). Supporting both is likely going to become more and more difficult as time goes by.
nvim was 8-10% faster than vim in my tests: https://adityam.github.io/context-blog/post/vim-vs-neovim/
Anyway, if you do want to support both, I'd suggest at least to segregate the two commands, even if currently they may be (almost) identical.
That's a good suggestion. For now, I'll play around with the order of options to seei if that fixes the problem. I agree that at some stage it might be better to simply split off the module into a `t-nvim.tex` which configures the settings for nvim separately. I actually want t-vim (or rather t-filter) to support more editors/syntax highlighters. At some stage I had added rudimentary support for other syntax highlighters most of them required scaffolding to wrap around the latex output: https://adityam.github.io/context-blog/post/clean-tex-output/ Aditya