O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving our plugin

There are many paths we can take our plugin in, but let's focus on two main issues we have right now:

  • Our plugin fails with spectacular errors when we try to execute it in any other language
  • The plugin does not provide a way to operate on multiple lines at once

Let's start with the first problem: making the plugin work across different languages. Right now, if you try to execute the plugin in, for example, a .vim file, you'll get the following volley of errors:

That's because we define g:commenter#comment_str in <...>/vim-commenter/ftplugin/python.vim, and the variable is only defined when we're working with a Python ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required