I can't get custom syntax highlight of the LaTeX \footnote command to work. I'm using nvim 0.4.3 through VimR.

I put the following in ./.vim/after/syntax/tex.vim (Edit: my runtimepath is ./.vim/ instead of ./.config/ -- I did try to put the file in ./.config/after/syntax/ but to no avail)

syntax match footnote "footnote"
highlight link footnote Todo

(I intend to use a regex pattern later, if I can get this simple version to work) Nothing happens when I type the command in a random .tex file. Not even after I do :set syntax=tex and not even with a minimal .vimrc with all plugins disabled.

Checking :scriptnames I see that the custom file is loaded as one of the very last files, right after the default syntax file in my VimR installation. The indent/tex.vim in my VimR installation is loaded even later.

  • 1
    Your config root must be ~/.config/nvim
    – Matt
    Jul 16 '20 at 9:28
  • @Matt not necessarily, a lot of users have set runtimepath^=~/.vim in their init.vim so that their configuration is shared between vim and neovim. But it's still worth to check the output of set runtimepath to make sure this is the case @ Timothy.
    – statox
    Jul 16 '20 at 11:50
  • @statox Really? Isn't a dir symlink simpler?
    – Matt
    Jul 16 '20 at 11:54
  • 1
    It can be, I guess it depends on everyone's preference. But I know I've seen this set runtimepath in a several configs, maybe because of one popular blog post somewhere which encourage every new neovim user to do that without having a second thought :)
    – statox
    Jul 16 '20 at 12:11
  • Just to make sure I have edited my config root. Everything is now in .config/nvim/ but the problem persists. Jul 16 '20 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.