Dominique Pellé wrote: > > Please try and review the attached patch. > > It think it does what's needed and it's rather simple: > > > > :setfiletype completes using things that match > > $VIMRUNTIME/{syntax,ftplugin,indent}/*.vim and > > ~/.vim/{syntax,ftplugin,indent}/*.vim > > > > :ownsyntax behaves as before, i.e. it completes using things that > > match $VIMRUNTIME/syntax/*.vim and ~/.vim/syntax/*.vim > > > > You can verify that :ownsyntax and :setfiletype complete > > differently with this example: > > > > :setfiletype host<CTRL-D> > > hostconf hostsaccess > > > > :ownsyntax host<CTRL-D> > > hostconf > > > > I have not done anything about the special files such as > > syntax/2html.vim. I could hard-code something to exclude > > them but it'd be ugly. Hopefully we can consider moving > > those special files. > > > I send this patch again with slightly more elegant way of doing it > saving 3 lines of code. Sorry for the noise.
Thanks. I'll await the updated version that re-uses the function to remove duplicates. Using fnamecmp() or STRCMP(): fnamecmp() should work the same or slightly better. E.g. if there is an indent/perl.vim and syntax/Perl.vim it should end up only in "perl". But only on systems where case is ignored. That's about correct, it matches the way Vim will find and read the file from the filetype. Another solution would be to lower case the name always, as filetypes are supposed to be lower case. -- How come wrong numbers are never busy? /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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