Chapter 3The Autoload System
Vim’s autoload system lets us easily break out our plugin’s code into manageable scripts with reusable functions. There are other ways to have multiple files working together in a plugin and reuse our code, but they can get rickety. The autoload system is specifically designed for this purpose, and it also keeps our plugin’s functions from colliding with any similarly named others—in that regard we can use it to provide a form of namespace for our functions.
We’re going to start this chapter by seeing how to take advantage of autoload—and as a bonus, we’ll make our plugin a bit smarter while we’re at it. Then we’ll see how we can get text from the playlist buffer so that users are able to play a selected song ...
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