Peter Odding wrote: > Ingo Karkat wrote: >> >> Granted, most filetypes do define custom highlighting via a >> $VIMRUNTIME/syntax/<filetype>.vim script. But shouldn't the filetype >> completion >> also take into account files from the ftplugin and syntax directories, >> too? >> If I for example have a custom filetype "bullettext" that defines custom >> fold >> and indent settings, but no highlighting, I would expect to have this >> filetype >> included in the completion. > > Like Ingo I have several custom file types under my ~/.vim/ directory that > don't have an associated syntax script and visa versa. > > Bram Molenaar wrote: >> >> Aha, so the filetypes are found by looking in the syntax directory. >> Well, the result is still a list of filetypes, although there can be a >> few syntax files that are not a filetype (e.g. 2html.vim). So do we let >> the implementation details prevail? Or stick to the intention? > > If sticking to the intention doesn't involve too much code that would IMHO > be preferable to the current implementation because of the reason given > above. > > Ideally file type completion would consider the base filenames of the Vim > scripts in the system wide / user specific ftplugin / syntax / indent > directories (and also their /after/ variants) but this might be too complex?
I can try to change the behavior. But just to make sure I understand the problems: :setfiletype and :ownsyntax commands currently both perform completion by looking at syntax/*.vim from both $VIMRUNTIME and ~/.vim/. That's almost fine, but it not ideal for 2 reasons: 1/ :setfiletype should actually complete by looking at files matching {syntax,ftplugin,indent}/*.vim from both $VIMRUNTIME/ and ~/.vim/ :ownsyntax completion should only look at syntax/*.vim (as it does now). 2/ there are a few files matching syntax/*.vim which are not syntax files such as 2html.vim, syntax.vim, colortest.vim... They can thus show up as a spurious completion results. These special files are listed in syntax/README.txt. Any reasons for them to be in the syntax/ directory? In practice, current implementation is almost fine since almost all files matching $VIMRUNTIME/{ftplugin,indent}/*.vim have a corresponding file matching $VIMRUNTIME/syntax/*.vim. Using the following commands... $ cd /usr/local/share/vim/vim73c $ vim -d <(cd syntax/; ls *.vim) <(cd ftplugin/; ls *.vim) $ vim -d <(cd syntax/; ls *.vim) <(cd indent/; ls *.vim) ... I see only 3 files matching ftplugin/*.vim which do not correspond to any file syntax/*.vim - ftplugin/hostaccess.vim - ftplugin/quickfix.vim - ftplugin/AppendMatchGroup.vim: this file does not look like a file type plugin anyway. It appears to contain a helper function. Should it really be there? And 1 file matching index/*.vim which has no corresponding files matching syntax/*.vim: - indent/GenericIndent.vim: this file is not an indent file but contains helper functions. Should it be stored somewhere else? I don't think this is a blocker for the release but Bram can decide :-) -- Dominique -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php