Jake Worth

Note: any code contained in this post is more than a year old. Please use at your own risk.

After a recent talk I gave that included Vimscript, an attendee asked a question about the differences between keyword, match, and region following syn in a Vim syntax highlighting file.

These three short chapters from 'Learn Vimscript the Hard Way' help explain:

Here's the short version:

  • keyword assigns a variable name directly to a word or multiple words
  • match assigns a variable name to a Vim regex
  • region assigns a variable name to something between a start pattern and an end pattern

For more info, check out the Vim help pages for each:

:help syn-keyword
:help syn-match
:help syn-region

Apr 20, 2016

← Career Interview Questions :: 60 Days 60 Contributions →
Hi! I'm Jake Worth, a developer at Hashrocket, based in Chicago. I co-organize Vim Chicago. Read my blog, learn about my work, follow me on Twitter and Github, get in touch.