-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommands.py
More file actions
27 lines (18 loc) · 813 Bytes
/
commands.py
File metadata and controls
27 lines (18 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from vimpy import Command, variables
class VimpyExample(Command):
""" A command for changing variables related vimpy_example's Plugin. """
def run(self, message=None):
""" This function gets called with :VimpyExample.
This function gets called when executing the :VimpyExample command
from Vim. It can be used in the following ways:
:VimpyExample
:VimpyExample "A new message."
:VimpyExample message=hi
"""
if message is None:
if 'vimpy_example_left_message' in variables.globals:
del variables.globals['vimpy_example_left_message']
print('No left message set.')
else:
variables.globals['vimpy_example_left_message'] = message
print('New message: ' + message)