O'Reilly logo

The VimL Primer by Benjamin Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required