Search code examples
vimneovim

How to check which (Neo)vim syntax highlighting plugin is being used


The title basically explains the gist of it. I am having some issues with my syntax highlighting, and I understand it is possible to check the filetype I am in currently with :setlocal syntax? and that I can check the specification of the highlighting with :syn list, but I am looking to see what plugin or native Neovim functionality is currently in control of syntax highlighting.


Solution

  • None of the :syntax subcommands works with :help :verbose-cmd, which is a tool commonly used for debugging mappings, commands, etc. So, without :verbose or a dedicated command, you are left with very fuzzy heuristics like:

    $ vim foo.js
    :filter syntax scriptnames
    

    which shows what syntax scripts have been sourced in the current session:

      6: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
      7: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
      8: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
     64: ~/.vim/pack/lang/start/javascript/syntax/javascript.vim
     65: ~/.vim/pack/lang/start/javascript/syntax/javascript/html5.vim
     66: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/javascript.vim
     67: ~/.vim/pack/lang/start/javascript/after/syntax/javascript.vim