Home Explore Blog CI



neovim

5th chunk of `runtime/doc/syntax.txt`
d2282f15ee4a3274c11209d2175bd5613ddaaf8d3a3689260000000100000fa2
 This
    |	should always load $VIMRUNTIME/scripts.vim, which does the following.
    |	|
    |	+-  Source the user's optional file, from the *myscriptsfile*
    |	|   variable.  This is for backwards compatibility with Vim 5.x only.
    |	|
    |	+-  If the file type is still unknown, check the contents of the file,
    |	    again with checks like "getline(1) =~ pattern" as to whether the
    |	    file type can be recognized, and set 'filetype'.
    |
    +-	When the file type was determined and 'filetype' was set, this
    |	triggers the FileType autocommand |synload-6| above.  It sets
    |	'syntax' to the determined file type.
    |
    +-	When the 'syntax' option was set above, this triggers an autocommand
    |	from |synload-1| (and |synload-2|).  This find the main syntax file in
    |	'runtimepath', with this command:
    |		runtime! syntax/<name>.vim
    |
    +-	Any other user installed FileType or Syntax autocommands are
	triggered.  This can be used to change the highlighting for a specific
	syntax.

==============================================================================
4. Conversion to HTML				*convert-to-HTML* *2html.vim*

The old to html converter has been replaced by a Lua version and the
documentation has been moved to |:TOhtml|.

==============================================================================
5. Syntax file remarks					*:syn-file-remarks*

						*b:current_syntax-variable*
Vim stores the name of the syntax that has been loaded in the
"b:current_syntax" variable.  You can use this if you want to load other
settings, depending on which syntax is active.	Example: >
   :au BufReadPost * if b:current_syntax == "csh"
   :au BufReadPost *   do-some-things
   :au BufReadPost * endif



ABEL						*abel.vim* *ft-abel-syntax*

ABEL highlighting provides some user-defined options.  To enable them, assign
any value to the respective variable.  Example: >
	:let abel_obsolete_ok=1
To disable them use ":unlet".  Example: >
	:unlet abel_obsolete_ok

Variable			Highlight ~
abel_obsolete_ok		obsolete keywords are statements, not errors
abel_cpp_comments_illegal	do not interpret '//' as inline comment leader


ADA

See |ft-ada-syntax|


ANT						*ant.vim* *ft-ant-syntax*

The ant syntax file provides syntax highlighting for javascript and python
by default.  Syntax highlighting for other script languages can be installed
by the function AntSyntaxScript(), which takes the tag name as first argument
and the script syntax file name as second argument.  Example: >

	:call AntSyntaxScript('perl', 'perl.vim')

will install syntax perl highlighting for the following ant code >

	<script language = 'perl'><![CDATA[
	    # everything inside is highlighted as perl
	]]></script>

See |mysyntaxfile-add| for installing script languages permanently.


APACHE						*apache.vim* *ft-apache-syntax*

The apache syntax file provides syntax highlighting for Apache HTTP server
version 2.2.3.


		*asm.vim* *asmh8300.vim* *nasm.vim* *masm.vim* *asm68k*
ASSEMBLY	*ft-asm-syntax* *ft-asmh8300-syntax* *ft-nasm-syntax*
		*ft-masm-syntax* *ft-asm68k-syntax* *fasm.vim*

Files matching "*.i" could be Progress or Assembly.  If the automatic detection
doesn't work for you, or you don't edit Progress at all, use this in your
startup vimrc: >
   :let filetype_i = "asm"
Replace "asm" with the type of assembly you use.

There are many types of assembly languages that all use the same file name
extensions.  Therefore you will have to select the type yourself, or add a
line in the assembly file that Vim will recognize.  Currently these syntax
files are included:
	asm		GNU assembly (usually have .s or .S extension and were
			already built using C compiler such as GCC or CLANG)
	asm68k		Motorola 680x0 assembly
	asmh8300	Hitachi H-8300 version of GNU assembly
	ia64		Intel Itanium 64
	fasm		Flat assembly (https://flatassembler.net)
	masm		Microsoft assembly (.masm files are compiled with
			Microsoft's Macro Assembler. This is only supported
			for

Title: Syntax Highlighting Details and Specific Languages
Summary
The chunk discusses how Vim determines file types and loads corresponding syntax files, including fallback mechanisms. It notes the replacement of the old HTML converter with a Lua version and provides language-specific syntax file remarks, options, and examples for ABEL, ADA, ANT, APACHE, and ASSEMBLY. For ASSEMBLY, it addresses file type detection challenges and lists supported assembly syntax files.