Summary
That was quite a bit of work! Let’s do a quick recap!
We’ve learned that Vimscript lets you take Vim anywhere you want, limiting your productivity only by your imagination. We’ve covered setting and manipulating variables, working with lists and dictionaries, surfacing output, and control flows using if
, for
, and while
statements. We’ve also covered functions, lambda expressions, the Vimscript equivalent of classes, as well as some more functional approaches using map and filter functions. We’ve also looked at Vim-specific commands and functions.
We’ve also built our first plugin, vim-commenter. The plugin lets you comment and uncomment lines in a Python file at the press of a button (well, two). We’ve learned how to structure our plugins, and how to use Vimscript to accomplish our goals. We’ve even brushed on distributing the plugin!
Lastly, we covered a few possible directions you can take for learning Vimscript...