Chapter 2A Real Live Plugin

Have you ever added code to or edited your Vim configuration file, .vimrc? If so, you’ve written code in VimL. As you saw in the previous chapter, VimL largely consists of commands like we run on the Vim command line. A .vimrc, the traditional place to put customizations and user functions, is a VimL script file. Beyond simply editing our .vimrc, we can modularize our VimL code and make it easily distributable—either for our own use or to share with other Vim users—by packaging it as a Vim plugin.

As you saw in the previous chapter, a plugin can be as small as a single script that lives in the plugin directory. That’s what we’ll start with here. When we finish this chapter, we’ll have a plugin that opens a new ...

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.