Re: RFC: (x)html completion support in Vim7
On Thu, Apr 20, 2006 at 10:51:04PM +0200, Mikolaj Machowski wrote: Hello, I am author of (x)html completion scripts and related (php, css, javascript). I'd like to ask what you think it should like. At the beginning I was pushing for one default: XHTML 1.0 Strict. Bram didn't like it and now there are two: fot ft='html' HTML 4.01 Transitional and for ft=='xhtml' XHTML 1.0 Strict (user can still choose another version with b:html_omni_flavor variable - this improvement may be not yet in snapshot/cvs/svn). Bram still doesn't like it. According for him completion should be more flexible and not limited to some standard. For me it defies whole idea of omni-completion - completion suggestions should be precise. Problem with (X)HTML is there are many standards but creation of messy compilation from them has no sense. Vim is superb program and should support writing of good code - according to standards. I like the idea of encouraging XHTML 1.0 Strict, but since I write so little HTML code myself, perhaps my vote should be discounted. To make this support full it could look: - provide data files for most of (X)HTML standards: - HTML 3.2 Strict (for legacy pages) - HTML 4.0 Transitional - HTML 4.0 Strict - HTML 4.0 Frameset - HTML 4.01 Transitional - HTML 4.01 Strict - HTML 4.01 Frameset - XHTML 1.0 Transitional - XHTML 1.0 Strict - XHTML 1.0 Frameset - XHTML 1.1 That is 11 data files, ca. 45kB each (5kB packed) - total 500 kB (55kB) I have not looked at the structure of the completion scripts, but isn't there a way for one script to include another? Under $VIMRUNTIME/ftplugin/ the file tex.vim (for LaTeX) :source's plaintex.vim , which :source's initex.vim . You should be able to do something similar with XHTML 1.0 Frameset/Transitional/Strict. This strategy no only reduces file size, it also makes maintenance easier. Suppose someone notices a mistake in one of these files: do you want to correct it in one place or in three? Add functions for detection of DOCTYPE to ftplugins for xhtml and html. Still there is usability problem for creation of new files. Maybe some general completion for insertion of DOCTYPE and setting appropriately completion. Right, and allow users to set a variable (g:html_omni_version or something) that the ftplugins can check to use as a default for new files. HTH --Benji Fisher
Re: RFC: (x)html completion support in Vim7
Dnia poniedziaĆek, 24 kwietnia 2006 15:00, Benji Fisher napisaĆ: I have not looked at the structure of the completion scripts, but isn't there a way for one script to include another? Under $VIMRUNTIME/ftplugin/ the file tex.vim (for LaTeX) :source's plaintex.vim , which :source's initex.vim . You should be able to do something similar with XHTML 1.0 Frameset/Transitional/Strict. Yes it is possible but because data files are generated automatically seeking a way to compress them is hard. Also, unification was done on level of engine between XML and HTML. This strategy no only reduces file size, it also makes maintenance easier. Actually no. Version with including had to be maintained manually and so far the only (reported) bug in data files was in file created manually. Also similarities between Frameset/Transitional/Strict are misleading and could lead to hard to spot errors. Add functions for detection of DOCTYPE to ftplugins for xhtml and html. Still there is usability problem for creation of new files. Maybe some general completion for insertion of DOCTYPE and setting appropriately completion. Right, and allow users to set a variable (g:html_omni_version or something) that the ftplugins can check to use as a default for new files. This will be done by insertion of DOCTYPE. m.
RFC: (x)html completion support in Vim7
Hello, I am author of (x)html completion scripts and related (php, css, javascript). I'd like to ask what you think it should like. At the beginning I was pushing for one default: XHTML 1.0 Strict. Bram didn't like it and now there are two: fot ft='html' HTML 4.01 Transitional and for ft=='xhtml' XHTML 1.0 Strict (user can still choose another version with b:html_omni_flavor variable - this improvement may be not yet in snapshot/cvs/svn). Bram still doesn't like it. According for him completion should be more flexible and not limited to some standard. For me it defies whole idea of omni-completion - completion suggestions should be precise. Problem with (X)HTML is there are many standards but creation of messy compilation from them has no sense. Vim is superb program and should support writing of good code - according to standards. To make this support full it could look: - provide data files for most of (X)HTML standards: - HTML 3.2 Strict (for legacy pages) - HTML 4.0 Transitional - HTML 4.0 Strict - HTML 4.0 Frameset - HTML 4.01 Transitional - HTML 4.01 Strict - HTML 4.01 Frameset - XHTML 1.0 Transitional - XHTML 1.0 Strict - XHTML 1.0 Frameset - XHTML 1.1 That is 11 data files, ca. 45kB each (5kB packed) - total 500 kB (55kB) Add functions for detection of DOCTYPE to ftplugins for xhtml and html. Still there is usability problem for creation of new files. Maybe some general completion for insertion of DOCTYPE and setting appropriately completion. TIA for comments. m.