Chapter 5Highlighting Syntax

Syntax highlighting is part of Vim’s filetype support for the wide variety of languages that it supports by default. It relies on syntax files, VimL script files that define the elements of languages and place them in standard categories so that Vim knows how to format and highlight code in those languages. When we come up with our own filetype, it’s up to us to tell Vim how to highlight that filetype’s syntax.

Our plugin project is getting close to where we’ll put on the finishing touches. In this chapter we’ll clean up the playlist track listing and create our own special syntax. Then we’ll prettify it with syntax highlighting. We’ll use the filetype we worked on in the previous chapter and see another facet ...

Get The VimL Primer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.