-
Notifications
You must be signed in to change notification settings - Fork 5
Commands
Brandon R. Stoner edited this page Jun 13, 2013
·
4 revisions
Vimpy provides a simple abstraction around Vim commands, allowing plugin developers to write complete commands in Python. These commands should be located in your package's commands module in order to be automatically imported by Vimpy.
Here is an example of how you could create a simple command:
from vimpy import Command
class HelloWorld(Command):
def run(self):
print('Hello, world.')
After saving this in your project package's commands.py, you will be able to open vim and run the following command in command mode:
:HelloWorld
If it all worked as expected, you should see the text 'Hello, world.' in your command line.