(I suspect this is a faq, but none of help helpgrep or
Google returns anything useful, or I can't come up with
the right search term. :-? )
TIA,
/BP
:echo glob($VIMRUNTIME . '/ftplugin/*.vim')
or
:echo glob($VIMRUNTIME . '/syntax/*.vim')
(I find the latter a better exhaustive list, the former are often
shared by multiple languages.)
> Preferably with info which criteria they are recognized by
> (file suffix, interpreter directive...)
Much tougher, each syntax/filetype is detected in a different way.
Often by extension, but sometimes by internal file structure or
format.
--
Steve Hall [ digitect dancingpaper com ]
While you got an answer to the first half, the second part takes
digging into multiple files. You want to look at the stock
filetypes in $VIMRUNTIME/filetype.vim first. If you've added any
plugins or scripts, they may have dropped in their own file-type
detection. To find them, you'd want to peek in all the files in
the "ftdetect" subdirectories of the paths listed in your
'runtimepath' setting (yes, it a bunch of places).
You can read more details in the help at
:help :filetype " for details on the global
:help new-filetype " for details on custom/local versions
Hope this helps,
-tim
The relevant help tags are
:help 'runtimepath'
:help filetype.txt
:help new-filetype
:help new-filetype-scripts
For the criteria, you can:
a) list the autocommands which identify them
:au filetypedetect
These autocommands are set by $VIMRUNTIME/filetype.vim; one of them runs
$VIMRUNTIME/scripts.vim to try to identify files from their contents
when the name, path, etc. are not enough.
b) check which filetypes have scripts to handle them
(gvim) Syntax => Show filetypes in menu
which, however, lists only preinstalled filetypes, and not with the name
under which the 'filetype' or 'syntax' option knows them;
or else, for each of the directories listed in the 'runtimepath' option,
list (using ls on Unix or dir, possibly dir /w to save space, on Windows):
<directory>/ftplugin/*.vim
<directory>/indent/*.vim
<directory>/syntax/*.vim
Note that 'filetype' (as used by ftplugin and indent scripts) and
'syntax' (as used by syntax scripts) are separate options, which have
usually the same value but could be different.
In a "vanilla" install of Vim with no third-party scripts installed, the
only value of <directory> above pointing to an existing, nonempty
directory is your $VIMRUNTIME directory.
Best regards,
Tony.