Home Explore Blog CI



neovim

21th chunk of `runtime/doc/insert.txt`
844ce4750afaf2b6391fca35703b9e86b40fe8ead5a3744a0000000100000fa0
 elements of (X)HTML files.  It is
designed to support writing of XHTML 1.0 Strict files but will also work for
other versions of HTML. Features:

- after "<" complete tag name depending on context (no div suggestion inside
  of an a tag); '/>' indicates empty tags
- inside of tag complete proper attributes (no width attribute for an a tag);
  show also type of attribute; "*" indicates required attributes
- when attribute has limited number of possible values help to complete them
- complete names of entities
- complete values of "class" and "id" attributes with data obtained from
  <style> tag and included CSS files
- when completing value of "style" attribute or working inside of "style" tag
  switch to |ft-css-omni| completion
- when completing values of events attributes or working inside of "script"
  tag switch to |ft-javascript-omni| completion
- when used after "</" CTRL-X CTRL-O will close the last opened tag

Note: When used first time completion menu will be shown with little delay
- this is time needed for loading of data file.
Note: Completion may fail in badly formatted documents. In such case try to
run |:make| command to detect formatting problems.


HTML flavor						*html-flavor*

The default HTML completion depends on the filetype.  For HTML files it is
HTML 4.01 Transitional ('filetype' is "html"), for XHTML it is XHTML 1.0
Strict ('filetype' is "xhtml").

When doing completion outside of any other tag you will have possibility to
choose DOCTYPE and the appropriate data file will be loaded and used for all
next completions.

More about format of data file in |xml-omni-datafile|. Some of the data files
may be found on the Vim website (|www|).

Note that b:html_omni_flavor may point to a file with any XML data.  This
makes possible to mix PHP (|ft-php-omni|) completion with any XML dialect
(assuming you have data file for it).  Without setting that variable XHTML 1.0
Strict will be used.


JAVASCRIPT					       *ft-javascript-omni*

Completion of most elements of JavaScript language and DOM elements.

Complete:

- variables
- function name; show function arguments
- function arguments
- properties of variables trying to detect type of variable
- complete DOM objects and properties depending on context
- keywords of language

Completion works in separate JavaScript files (&ft==javascript), inside of
<script> tag of (X)HTML and in values of event attributes (including scanning
of external files).

DOM compatibility

At the moment (beginning of 2006) there are two main browsers - MS Internet
Explorer and Mozilla Firefox. These two applications are covering over 90% of
market. Theoretically standards are created by W3C organisation
(https://www.w3.org/) but they are not always followed/implemented.
>
		IE	FF	W3C  Omni completion ~
		+/-	+/-	+    +		     ~
		+	+	-    +		     ~
		+	-	-    -		     ~
		-	+	-    -		     ~
<
Regardless from state of implementation in browsers but if element is defined
in standards, completion plugin will place element in suggestion list. When
both major engines implemented element, even if this is not in standards it
will be suggested. All other elements are not placed in suggestion list.


LUA                                                     *ft-lua-omni*

Lua |ftplugin| sets 'omnifunc' to |vim.lua_omnifunc()|.


PHP							*ft-php-omni*

Completion of PHP code requires a tags file for completion of data from
external files and for class aware completion. You should use Universal/
Exuberant ctags version 5.5.4 or newer. You can find it here:

	Universal Ctags: https://ctags.io

Script completes:

- after $ variables name
  - if variable was declared as object add "->", if tags file is available show
    name of class
  - after "->" complete only function and variable names specific for given
    class. To find class location and contents tags file is required. Because
    PHP isn't strongly typed language user can use @var tag to declare class: >

	/* @var $myVar myClass */
	$myVar->

Title: Details on HTML/XHTML, JavaScript, Lua, and PHP Omni Completion
Summary
This section provides detailed information on omni completion for HTML/XHTML, JavaScript, Lua, and PHP files. It describes the features and functionalities of HTML/XHTML completion, including tag and attribute completion, entity names, and integration with CSS and JavaScript. It also covers the specific aspects of JavaScript completion, such as variable and function completion, DOM object properties, and browser compatibility. The section briefly mentions Lua completion and then dives into PHP completion, emphasizing the requirement of a tags file for data completion from external files and class-aware completion. It also explains the support for variable name completion after '$' and class-specific function and variable name completion after '->'.