Chapter 6Commands and Mappings
We’ve been using Vim commands throughout this book. In fact, most of the code we’ve been writing in our script files could be executed on Vim’s command line as a long series of commands. But as with functions, we can write our own commands with VimL—they’re called user commands.
We can also map keys and key combinations. You might have mapped or remapped Vim functions before in your .vimrc file. Vim gives us a lot of choices for how we map keys—particularly when we include the mappings as part of our plugin—and even lets us give users an easy way to reconfigure those mappings to taste.
In this chapter we’ll start by writing commands that call our mpc functions. Then we’ll see how we can map keys to call our ...
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