Home Explore Blog CI



neovim

9th chunk of `runtime/doc/usr_44.txt`
9e4ee715dd4fd1f71bebf85819806150d3c2f473ddf2e4fb00000001000009ab
 match shIfSync grouphere shIf "\<if\>"

The "groupthere" argument tells Vim that the pattern ends a group.  For
example, the end of the if/fi group is as follows: >

	:syntax sync match shIfSync groupthere NONE "\<fi\>"

In this example, the NONE tells Vim that you are not in any special syntax
region.  In particular, you are not inside an if block.

You also can define matches and regions that are with no "grouphere" or
"groupthere" arguments.  These groups are for syntax groups skipped during
synchronization.  For example, the following skips over anything inside {},
even if it would normally match another synchronization method: >

	:syntax sync match xSpecial /{.*}/

More about synchronizing in the reference manual: |:syn-sync|.

==============================================================================
*44.11*	Installing a syntax file

When your new syntax file is ready to be used, drop it in a "syntax" directory
in 'runtimepath'.  For Unix that would be "~/.config/nvim/syntax".
  The name of the syntax file must be equal to the file type, with ".vim"
added.  Thus for the x language, the full path of the file would be:

	~/.config/nvim/syntax/x.vim ~

You must also make the file type be recognized.  See |43.2|.

If your file works well, you might want to make it available to other Vim
users.  First read the next section to make sure your file works well for
others.  Then e-mail it to the Vim maintainer: <maintainer@vim.org>.  Also
explain how the filetype can be detected.  With a bit of luck your file will
be included in the next Vim version!


ADDING TO AN EXISTING SYNTAX FILE

We were assuming you were adding a completely new syntax file.  When an existing
syntax file works, but is missing some items, you can add items in a separate
file.  That avoids changing the distributed syntax file, which will be lost
when installing a new version of Vim.
   Write syntax commands in your file, possibly using group names from the
existing syntax.  For example, to add new variable types to the C syntax file:
>
	:syntax keyword cType off_t uint

Write the file with the same name as the original syntax file.  In this case
"c.vim".  Place it in a directory near the end of 'runtimepath'.  This makes
it loaded after the original syntax file.  For Unix this would be:

	~/.config/nvim/after/syntax/c.vim ~

==============================================================================
*44.12*	Portable syntax file layout

Wouldn't it be nice

Title: Completing Syntax Definition and Installing Syntax Files
Summary
This section explains the 'groupthere' argument, which marks the end of a syntax group. It demonstrates how to define matches or regions without 'grouphere' or 'groupthere' for elements to be skipped during synchronization. The section then transitions to installing syntax files, detailing the naming convention and placement within the 'runtimepath'. It also covers contributing syntax files to the Vim project and adding to existing syntax files by creating a file with the same name in the 'after/syntax' directory, ensuring it's loaded after the original file.