Skip to content

Commit 00b34c3

Browse files
committed
Create commands for the tag plugin (&reformat)
1 parent 49ad0a1 commit 00b34c3

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

ftplugin/orgmode/plugins/TagsProperties.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,32 @@ def register(self):
155155
"""
156156
# an Action menu entry which binds "keybinding" to action ":action"
157157
settings.set(u'org_tag_column', u'77')
158-
159158
settings.set(u'org_tag_completion_ignorecase', int(vim.eval(u'&ignorecase')))
160159

161-
self.keybindings.append(Keybinding(u'<localleader>st', Plug(u'OrgSetTags', u':py ORGMODE.plugins[u"TagsProperties"].set_tags()<CR>')))
162-
self.menu + ActionEntry(u'Set &Tags', self.keybindings[-1])
163-
164-
self.keybindings.append(Keybinding(u'<localleader>ft', Plug(u'OrgFindTags', u':py ORGMODE.plugins[u"TagsProperties"].find_tags()<CR>')))
165-
self.menu + ActionEntry(u'&Find Tags', self.keybindings[-1])
166-
167-
self.commands.append(Command(u'OrgTagsRealign', u":py ORGMODE.plugins[u'TagsProperties'].realign_all_tags()"))
160+
cmd = Command(
161+
u'OrgSetTags',
162+
u':py ORGMODE.plugins[u"TagsProperties"].set_tags()<CR>')
163+
self.commands.append(cmd)
164+
keybinding = Keybinding(
165+
u'<localleader>st',
166+
Plug(u'OrgSetTags', cmd))
167+
self.keybindings.append(keybinding)
168+
self.menu + ActionEntry(u'Set &Tags', keybinding)
169+
170+
cmd = Command(
171+
u'OrgFindTags',
172+
u':py ORGMODE.plugins[u"TagsProperties"].find_tags()<CR>')
173+
self.commands.append(cmd)
174+
keybinding = Keybinding(
175+
u'<localleader>ft',
176+
Plug(u'OrgFindTags', cmd))
177+
self.keybindings.append(keybinding)
178+
self.menu + ActionEntry(u'&Find Tags', keybinding)
179+
180+
cmd = Command(
181+
u'OrgTagsRealign',
182+
u":py ORGMODE.plugins[u'TagsProperties'].realign_all_tags()")
183+
self.commands.append(cmd)
168184

169185
# workaround to align tags when user is leaving insert mode
170186
vim.command(u"""function Org_complete_tags(ArgLead, CmdLine, CursorPos)

0 commit comments

Comments
 (0)