Vim is syntax highlighting my file in a funny way, and I want to know what syntax file is responsible for this behaviour. How do I find out what syntax files vim has loaded?
The syntax for the current buffer can be queried via
It usually (but not necessarily) corresponds to the buffer's filetype (
For a deeper look,
shows all syntax definitions (some syntaxes (can) include other language's syntaxes, e.g.
html for the JavaDoc comment markup).
I guess you would like to know exactly which highlighting color scheme(syntax) is currently being used for the file opened, here is what I do:
as @garyjohn mentioned
But this will show you a complete list of settings currently loaded.
1: /usr/share/vim/vimrc 2: ~/.vimrc 3: /usr/share/vim/vim81/syntax/syntax.vim 4: /usr/share/vim/vim81/syntax/synload.vim 5: /usr/share/vim/vim81/syntax/syncolor.vim 6: /usr/share/vim/vim81/filetype.vim 7: /usr/share/vim/vim81/plugin/getscriptPlugin.vim 8: /usr/share/vim/vim81/plugin/gzip.vim 9: /usr/share/vim/vim81/plugin/logiPat.vim 10: /usr/share/vim/vim81/plugin/manpager.vim 11: /usr/share/vim/vim81/plugin/matchparen.vim 12: /usr/share/vim/vim81/plugin/netrwPlugin.vim 13: /usr/share/vim/vim81/plugin/rrhelper.vim 14: /usr/share/vim/vim81/plugin/spellfile.vim 15: /usr/share/vim/vim81/plugin/tarPlugin.vim 16: /usr/share/vim/vim81/plugin/tohtml.vim 17: /usr/share/vim/vim81/plugin/vimballPlugin.vim 18: /usr/share/vim/vim81/plugin/zipPlugin.vim 19: ~/.vim/syntax/applescript.vim
Then which exactly is the one doing coloring? => the last one always the decision maker(e.g.):
In my case, I want to test last downloaded syntax of applescript.vim if working.
On the other side, please be reminded that vim syntax is filetype/extension-based, so check exactly the file definition at
/usr/share/vim/vim81/filetype.vim, there you can easily find out AppleScript has its unique extension defined as
.scpt (as standard) .
Hope this helps also.