The Vim Syntax File
We know from The Structure of a Vim Plugin, that syntax files are kept in the syntax directory. Create a syntax directory under the main plugin directory if you haven’t done that yet. Then within it, create the file mpdv.vim.
Distinguishing Syntax Elements
We specify syntax elements by using the :syntax command. The command can define several different element types, but the ones we’re most commonly going to use are keyword, match, and region.
|
keyword |
Used to specify a keyword element or a list of keyword elements. |
|
match |
Used to specify a class of elements defined by a provided regular-expression pattern. |
|
region |
Used to specify an element defined by starting and ending regular-expression patterns. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access