def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # register plug self.keybindings.append(Keybinding(u'<Tab>', Plug(u'OrgToggleFoldingNormal', u'%s ORGMODE.plugins[u"ShowHide"].toggle_folding()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Cycle Visibility', self.keybindings[-1]) self.keybindings.append(Keybinding(u'<S-Tab>', Plug(u'OrgToggleFoldingReverse', u'%s ORGMODE.plugins[u"ShowHide"].toggle_folding(reverse=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Cycle Visibility &Reverse', self.keybindings[-1]) self.keybindings.append(Keybinding(u'<localleader>.', Plug(u'OrgGlobalToggleFoldingNormal', u'%s ORGMODE.plugins[u"ShowHide"].global_toggle_folding()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Cycle Visibility &Globally', self.keybindings[-1]) self.keybindings.append(Keybinding(u'<localleader>,', Plug(u'OrgGlobalToggleFoldingReverse', u'%s ORGMODE.plugins[u"ShowHide"].global_toggle_folding(reverse=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Cycle Visibility Reverse G&lobally', self.keybindings[-1]) for i in range(0, 10): self.keybindings.append(Keybinding(u'<localleader>%d' % (i,), u'zM:set fdl=%d<CR>' % i, mode=MODE_NORMAL))
def register(self): u""" Registration of the plugin. Key bindings and other initialization should be done here. """ self.keybindings.append( Keybinding( u'<localleader>sa', Plug(u'OrgDateInsertTimestampActive', u':py ORGMODE.plugins[u"Date"].insert_timestamp()<CR>'))) self.menu + ActionEntry(u'Timest&', self.keybindings[-1]) self.keybindings.append( Keybinding( u'<localleader>si', Plug( u'OrgDateInsertTimestampInactive', u':py ORGMODE.plugins[u"Date"].insert_timestamp(False)<CR>' ))) self.menu + ActionEntry(u'Timestamp (&inactive)', self.keybindings[-1]) submenu = self.menu + Submenu(u'Change &Date') submenu + ActionEntry(u'Day &Earlier', u'<C-x>', u'<C-x>') submenu + ActionEntry(u'Day &Later', u'<C-a>', u'<C-a>')
def register(self): """ Registration of plugin. Key bindings and other initialization should be done. """ settings.set('org_leader', ',') leader = settings.get('org_leader', ',') self.keybindings.append( Keybinding( '%sd' % leader, Plug( 'OrgToggleTodoToggle', ':silent! py ORGMODE.plugins["Todo"].toggle_todo_state()<CR>' ))) self.menu + ActionEntry('&TODO/DONE/-', self.keybindings[-1]) submenu = self.menu + Submenu('Select &keyword') self.keybindings.append( Keybinding( '<S-Right>', Plug( 'OrgToggleTodoForward', ':silent! py ORGMODE.plugins["Todo"].toggle_todo_state()<CR>' ))) submenu + ActionEntry('&Next keyword', self.keybindings[-1]) self.keybindings.append( Keybinding( '<S-Left>', Plug( 'OrgToggleTodoBackward', ':silent! py ORGMODE.plugins["Todo"].toggle_todo_state(False)<CR>' ))) submenu + ActionEntry('&Previous keyword', self.keybindings[-1]) settings.set('org_todo_keywords', ['TODO', '|', 'DONE'])
def register(self): u""" Registration and keybindings. """ # path to emacs executable settings.set(u'org_export_emacs', u'/usr/bin/emacs') # verbose output for export settings.set(u'org_export_verbose', 0) # allow the user to define an initialization script settings.set(u'org_export_init_script', u'') # to PDF self.commands.append(Command(u'OrgExportToPDF', \ u':py ORGMODE.plugins[u"Export"].topdf()<CR>')) self.keybindings.append( Keybinding(u'<localleader>ep', Plug(u'OrgExportToPDF', self.commands[-1]))) self.menu + ActionEntry(u'To PDF (via Emacs)', self.keybindings[-1]) # to HTML self.commands.append(Command(u'OrgExportToHTML', \ u':py ORGMODE.plugins[u"Export"].tohtml()<CR>')) self.keybindings.append( Keybinding(u'<localleader>eh', Plug(u'OrgExportToHTML', self.commands[-1]))) self.menu + ActionEntry(u'To HTML (via Emacs)', self.keybindings[-1])
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ self.keybindings.append( Keybinding( u'<localleader>ct', Plug( u'OrgTodoToggleNonInteractive', u':py ORGMODE.plugins[u"Todo"].toggle_todo_state(interactive=False)<CR>' ))) self.menu + ActionEntry(u'&TODO/DONE/-', self.keybindings[-1]) # add submenu submenu = self.menu + Submenu(u'Select &keyword') self.keybindings.append( Keybinding( u'<S-Right>', Plug(u'OrgTodoForward', u':py ORGMODE.plugins[u"Todo"].toggle_todo_state()<CR>'))) submenu + ActionEntry(u'&Next keyword', self.keybindings[-1]) self.keybindings.append( Keybinding( u'<S-Left>', Plug( u'OrgTodoBackward', u':py ORGMODE.plugins[u"Todo"].toggle_todo_state(direction=2)<CR>' ))) submenu + ActionEntry(u'&Previous keyword', self.keybindings[-1]) self.keybindings.append( Keybinding( u'<C-S-Right>', Plug( u'OrgTodoSetForward', u':py ORGMODE.plugins[u"Todo"].toggle_todo_state(next_set=True)<CR>' ))) submenu + ActionEntry(u'Next keyword &set', self.keybindings[-1]) self.keybindings.append( Keybinding( u'<C-S-Left>', Plug( u'OrgTodoSetBackward', u':py ORGMODE.plugins[u"Todo"].toggle_todo_state(direction=2, next_set=True)<CR>' ))) submenu + ActionEntry(u'Previous &keyword set', self.keybindings[-1]) settings.set(u'org_todo_keywords', [ u'TODO'.encode(u'utf-8'), u'|'.encode(u'utf-8'), u'DONE'.encode(u'utf-8') ]) settings.set(u'org_todo_prompt_position', u'botright') vim.command( u'au orgmode BufReadCmd org:todo/* :py ORGMODE.plugins[u"Todo"].init_org_todo()' .encode(u'utf-8'))
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # an Action menu entry which binds "keybinding" to action ":action" settings.set(u'org_tag_column', vim.eval(u'&textwidth')) settings.set(u'org_tag_completion_ignorecase', int(vim.eval(u'&ignorecase'))) cmd = Command(u'OrgSetTags', u':py ORGMODE.plugins[u"TagsProperties"].set_tags()') self.commands.append(cmd) keybinding = Keybinding(u'<localleader>st', Plug(u'OrgSetTags', cmd)) self.keybindings.append(keybinding) self.menu + ActionEntry(u'Set &Tags', keybinding) cmd = Command(u'OrgFindTags', u':py ORGMODE.plugins[u"TagsProperties"].find_tags()') self.commands.append(cmd) keybinding = Keybinding(u'<localleader>ft', Plug(u'OrgFindTags', cmd)) self.keybindings.append(keybinding) self.menu + ActionEntry(u'&Find Tags', keybinding) cmd = Command( u'OrgTagsRealign', u":py ORGMODE.plugins[u'TagsProperties'].realign_all_tags()") self.commands.append(cmd) # workaround to align tags when user is leaving insert mode vim.command(u"""function Org_complete_tags(ArgLead, CmdLine, CursorPos) python << EOF ORGMODE.plugins[u'TagsProperties'].complete_tags() EOF if exists('b:org_complete_tags') let tmp = b:org_complete_tags unlet b:org_complete_tags return tmp else return [] endif endfunction""".encode(u'utf-8')) vim.command(u"""function Org_realign_tags_on_insert_leave() if !exists('b:org_complete_tag_on_insertleave_au') :au orgmode InsertLeave <buffer> :py ORGMODE.plugins[u'TagsProperties'].realign_tags() let b:org_complete_tag_on_insertleave_au = 1 endif endfunction""".encode(u'utf-8')) # this is for all org files opened after this file vim.command( u"au orgmode FileType org call Org_realign_tags_on_insert_leave()". encode(u'utf-8')) # this is for the current file vim.command( u"call Org_realign_tags_on_insert_leave()".encode(u'utf-8'))
def register(self): u""" Registration of the plugin. Key bindings and other initialization should be done here. """ add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampActiveCmdLine', key_mapping=u'<localleader>sa', function=u'%s ORGMODE.plugins[u"Date"].insert_timestamp()' % VIM_PY_CALL, menu_desrc=u'Timest&') add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampInactiveCmdLine', key_mapping='<localleader>si', function=u'%s ORGMODE.plugins[u"Date"].insert_timestamp(False)' % VIM_PY_CALL, menu_desrc=u'Timestamp (&inactive)') add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampActiveWithCalendar', key_mapping=u'<localleader>pa', function= u'%s ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar()' % VIM_PY_CALL, menu_desrc=u'Timestamp with Calendar') add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampInactiveWithCalendar', key_mapping=u'<localleader>pi', function= u'%s ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar(False)' % VIM_PY_CALL, menu_desrc=u'Timestamp with Calendar(inactive)') add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampHeaderSchedule', key_mapping=u'<localleader>cs', function= u'%s ORGMODE.plugins[u"Date"].insert_timestamp_header("SCHEDULED")' % VIM_PY_CALL, menu_desrc=u'Timestamp with Calendar(inactive)') add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampHeaderDeadline', key_mapping=u'<localleader>cd', function= u'%s ORGMODE.plugins[u"Date"].insert_timestamp_header("DEADLINE")' % VIM_PY_CALL, menu_desrc=u'Timestamp with Calendar(inactive)') submenu = self.menu + Submenu(u'Change &Date') submenu + ActionEntry(u'Day &Earlier', u'<C-x>', u'<C-x>') submenu + ActionEntry(u'Day &Later', u'<C-a>', u'<C-a>')
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # an Action menu entry which binds "keybinding" to action ":action" self.commands.append(Command(u'OrgLoggingRecordDoneTime', u':py ORGMODE.plugins[u"LoggingWork"].action()')) self.menu + ActionEntry(u'&Record DONE time', self.commands[-1])
def register(self): u""" Registration of the plugin. Key bindings and other initialization should be done here. """ add_cmd_mapping_menu( self, name=u'OrgDateInsertScheduledDateLine', key_mapping=u'<localleader>sa', function=u':py ORGMODE.plugins[u"Date"].add_scheduled_date_line()', menu_desrc=u'Timestamp' ) add_cmd_mapping_menu( self, name=u'OrgDateInsertDeadlineDateLine', key_mapping=u'<localleader>da', function=u':py ORGMODE.plugins[u"Date"].add_deadline_date_line()', menu_desrc=u'Timestamp' ) add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampInactiveCmdLine', key_mapping='<localleader>si', function=u':py ORGMODE.plugins[u"Date"].insert_timestamp(False)', menu_desrc=u'Timestamp (&inactive)' ) add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampActiveWithCalendar', key_mapping=u'<localleader>pa', function=u':py ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar()', menu_desrc=u'Timestamp with Calendar' ) add_cmd_mapping_menu( self, name=u'OrgDateInsertTimestampInactiveWithCalendar', key_mapping=u'<localleader>pi', function=u':py ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar(False)', menu_desrc=u'Timestamp with Calendar(inactive)' ) submenu = self.menu + Submenu(u'Change &Date') submenu + ActionEntry(u'Day &Earlier', u'<C-x>', u'<C-x>') submenu + ActionEntry(u'Day &Later', u'<C-a>', u'<C-a>')
def register(self): """ Registration of plugin. Key bindings and other initialization should be done. """ self.commands.append( Command('OrgHyperlinkFollow', ':py ORGMODE.plugins["Hyperlinks"].follow()')) self.keybindings.append( Keybinding('gl', Plug('OrgHyperlinkFollow', self.commands[-1]))) self.menu + ActionEntry('&Follow Link', self.keybindings[-1]) self.commands.append( Command('OrgHyperlinkCopy', ':py ORGMODE.plugins["Hyperlinks"].follow(action="copy")')) self.keybindings.append( Keybinding('gyl', Plug('OrgHyperlinkCopy', self.commands[-1]))) self.menu + ActionEntry('&Copy Link', self.keybindings[-1]) self.commands.append( Command('OrgHyperlinkInsert', ':py ORGMODE.plugins["Hyperlinks"].insert(<f-args>)', arguments='*')) self.keybindings.append( Keybinding('gil', Plug('OrgHyperlinkInsert', self.commands[-1]))) self.menu + ActionEntry('&Insert Link', self.keybindings[-1]) self.menu + Separator() # find next link self.commands.append( Command( 'OrgHyperlinkNextLink', ":if search('\[\{2}\zs[^][]*\(\]\[[^][]*\)\?\ze\]\{2}', 's') == 0 | echo 'No further link found.' | endif" )) self.keybindings.append( Keybinding('gn', Plug('OrgHyperlinkNextLink', self.commands[-1]))) self.menu + ActionEntry('&Next Link', self.keybindings[-1]) # find previous link self.commands.append( Command( 'OrgHyperlinkPreviousLink', ":if search('\[\{2}\zs[^][]*\(\]\[[^][]*\)\?\ze\]\{2}', 'bs') == 0 | echo 'No further link found.' | endif" )) self.keybindings.append( Keybinding('go', Plug('OrgHyperlinkPreviousLink', self.commands[-1]))) self.menu + ActionEntry('&Previous Link', self.keybindings[-1]) self.menu + Separator() # Descriptive Links self.commands.append( Command('OrgHyperlinkDescriptiveLinks', ':setlocal cole=2')) self.menu + ActionEntry('&Descriptive Links', self.commands[-1]) # Literal Links self.commands.append( Command('OrgHyperlinkLiteralLinks', ':setlocal cole=0')) self.menu + ActionEntry('&Literal Links', self.commands[-1])
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ cmd = Command( u'OrgHyperlinkFollow', u'%s ORGMODE.plugins[u"Hyperlinks"].follow()' % VIM_PY_CALL) self.commands.append(cmd) self.keybindings.append( Keybinding(u'gl', Plug(u'OrgHyperlinkFollow', self.commands[-1]))) self.menu + ActionEntry(u'&Follow Link', self.keybindings[-1]) cmd = Command( u'OrgHyperlinkCopy', u'%s ORGMODE.plugins[u"Hyperlinks"].follow(action=u"copy")' % VIM_PY_CALL) self.commands.append(cmd) self.keybindings.append( Keybinding(u'gyl', Plug(u'OrgHyperlinkCopy', self.commands[-1]))) self.menu + ActionEntry(u'&Copy Link', self.keybindings[-1]) cmd = Command( u'OrgHyperlinkInsert', u'%s ORGMODE.plugins[u"Hyperlinks"].insert(<f-args>)' % VIM_PY_CALL, arguments=u'*') self.commands.append(cmd) self.keybindings.append( Keybinding(u'gil', Plug(u'OrgHyperlinkInsert', self.commands[-1]))) self.menu + ActionEntry(u'&Insert Link', self.keybindings[-1]) self.menu + Separator() # find next link cmd = Command( u'OrgHyperlinkNextLink', u":if search('\\[\\{2}\\zs[^][]*\\(\\]\\[[^][]*\\)\\?\\ze\\]\\{2}', 's') == 0 | echo 'No further link found.' | endif") self.commands.append(cmd) self.keybindings.append( Keybinding(u'gn', Plug(u'OrgHyperlinkNextLink', self.commands[-1]))) self.menu + ActionEntry(u'&Next Link', self.keybindings[-1]) # find previous link cmd = Command( u'OrgHyperlinkPreviousLink', u":if search('\\[\\{2}\\zs[^][]*\\(\\]\\[[^][]*\\)\\?\\ze\\]\\{2}', 'bs') == 0 | echo 'No further link found.' | endif") self.commands.append(cmd) self.keybindings.append( Keybinding(u'go', Plug(u'OrgHyperlinkPreviousLink', self.commands[-1]))) self.menu + ActionEntry(u'&Previous Link', self.keybindings[-1]) self.menu + Separator() # Descriptive Links cmd = Command(u'OrgHyperlinkDescriptiveLinks', u':setlocal cole=2') self.commands.append(cmd) self.menu + ActionEntry(u'&Descriptive Links', self.commands[-1]) # Literal Links cmd = Command(u'OrgHyperlinkLiteralLinks', u':setlocal cole=0') self.commands.append(cmd) self.menu + ActionEntry(u'&Literal Links', self.commands[-1])
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # an Action menu entry which binds "keybinding" to action ":action" self.commands.append(Command(u'OrgCaptureTodo', u'%s ORGMODE.plugins[u"Capture"].create_todo()' % VIM_PY_CALL)) self.commands.append(Command(u'OrgCaptureJournal', u'%s ORGMODE.plugins[u"Capture"].create_journal()' % VIM_PY_CALL)) self.commands.append(Command(u'OrgCaptureSaveTodo', u'%s ORGMODE.plugins[u"Capture"].save_todo()' % VIM_PY_CALL)) self.commands.append(Command(u'OrgCaptureSaveJournal', u'%s ORGMODE.plugins[u"Capture"].save_journal()' % VIM_PY_CALL)) self.menu + ActionEntry(u'&Capture', self.commands[-1])
def register(self): u""" Registration and keybindings. """ # to PDF self.keybindings.append( Keybinding( u'<localleader>ep', Plug(u'OrgExportToPDF', u':py ORGMODE.plugins[u"Export"].topdf()<CR>'))) self.menu + ActionEntry(u'To PDF (via Emacs)', self.keybindings[-1]) # to HTML self.keybindings.append( Keybinding( u'<localleader>eh', Plug(u'OrgExportToHTML', u':py ORGMODE.plugins[u"Export"].tohtml()<CR>'))) self.menu + ActionEntry(u'To HTML (via Emacs)', self.keybindings[-1])
def register(self): u""" Registration of the plugin. Key bindings and other initialization should be done here. """ self.keybindings.append(Keybinding(u'<localleader>cat', Plug(u'OrgAgendaTodo', u':py ORGMODE.plugins[u"Agenda"].list_all_todos()<CR>'))) self.menu + ActionEntry(u'Agenda for all TODOs', self.keybindings[-1]) self.keybindings.append(Keybinding(u'<localleader>caa', Plug(u'OrgAgendaWeek', u':py ORGMODE.plugins[u"Agenda"].list_next_week()<CR>'))) self.menu + ActionEntry(u'Agenda for the week', self.keybindings[-1]) self.keybindings.append(Keybinding(u'<localleader>caL', Plug(u'OrgAgendaTimeline', u':py ORGMODE.plugins[u"Agenda"].list_timeline()<CR>'))) self.menu + ActionEntry(u'Timeline for this buffer', self.keybindings[-1])
def register(self): u""" Registration of the plugin. Key bindings and other initialization should be done here. """ # an Action menu entry which binds "keybinding" to action ":action" self.commands.append(Command(u'OrgActionCommand', u':py ORGMODE.plugins["Example"].action()')) self.keybindings.append(Keybinding(u'keybinding', Plug(u'OrgAction', self.commands[-1]))) self.menu + ActionEntry(u'&Action', self.keybindings[-1])
def register(self): """ Registration of the plugin. Key bindings and other initialization should be done here. """ settings.set('org_leader', ',') leader = settings.get('org_leader', ',') self.keybindings.append( Keybinding( '%stn' % leader, Plug('OrgDateInsertTimestampActive', ':py ORGMODE.plugins["Date"].insert_timestamp()<CR>'))) self.menu + ActionEntry('Timestamp', self.keybindings[-1]) self.keybindings.append( Keybinding( '%sti' % leader, Plug( 'OrgDateInsertTimestampInactive', ':py ORGMODE.plugins["Date"].insert_timestamp(False)<CR>')) ) self.menu + ActionEntry('Timestamp (inactive)', self.keybindings[-1])
def register(self): u""" Registration and keybindings. """ # leader settings settings.set(u'org_leader', u',') leader = settings.get(u'org_leader', u',') # to PDF self.keybindings.append( Keybinding( u'%sep' % leader, Plug(u'OrgExportToPDF', u':py ORGMODE.plugins[u"Export"].topdf()<CR>'))) self.menu + ActionEntry(u'To PDF (via Emacs)', self.keybindings[-1]) # to HTML self.keybindings.append( Keybinding( u'%seh' % leader, Plug(u'OrgExportToHTML', u':py ORGMODE.plugins[u"Export"].tohtml()<CR>'))) self.menu + ActionEntry(u'To HTML (via Emacs)', self.keybindings[-1])
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # register plug self.keybindings.append(Keybinding(u'<Tab>', Plug(u'OrgToggleFolding', u':py ORGMODE.plugins[u"ShowHide"].toggle_folding()<CR>'))) self.menu + ActionEntry(u'&Cycle Visibility', self.keybindings[-1]) settings.set(u'org_leader', u',') leader = settings.get(u'org_leader', u',') self.keybindings.append(Keybinding(u'%s,' % (leader, ), u':exe ":set fdl=". (&fdl - 1)<CR>', mode=MODE_NORMAL)) self.keybindings.append(Keybinding(u'%s.' % (leader, ), u':exe ":set fdl=". (&fdl + 1)<CR>', mode=MODE_NORMAL)) for i in xrange(0, 10): self.keybindings.append(Keybinding(u'%s%d' % (leader, i), u'zM:set fdl=%d<CR>' % i, mode=MODE_NORMAL))
def register(self): """ Registration of plugin. Key bindings and other initialization should be done. """ # an Action menu entry which binds "keybinding" to action ":action" settings.set('org_tags_column', '77') settings.set('org_tags_completion_ignorecase', '0') settings.set('org_leader', ',') leader = settings.get('org_leader', ',') self.keybindings.append( Keybinding( '%st' % leader, Plug('OrgSetTags', ':py ORGMODE.plugins["TagsProperties"].set_tags()<CR>'))) self.menu + ActionEntry('Set &Tags', self.keybindings[-1]) self.commands.append( Command( 'OrgTagsRealign', ":py ORGMODE.plugins['TagsProperties'].realign_all_tags()")) # workaround to align tags when user is leaving insert mode vim.command("""function Org_complete_tags(ArgLead, CmdLine, CursorPos) python << EOF ORGMODE.plugins['TagsProperties'].complete_tags() EOF if exists('b:org_complete_tags') let tmp = b:org_complete_tags unlet b:org_complete_tags return tmp else return [] endif endfunction""") # this is for all org files opened after this file vim.command( "au FileType org :au InsertLeave <buffer> :py ORGMODE.plugins['TagsProperties'].realign_tags()" ) # this is for the current file vim.command( "au InsertLeave <buffer> :py ORGMODE.plugins['TagsProperties'].realign_tags()" )
def register(self): # normal mode self.keybindings.append(Keybinding(u'g{', Plug('OrgJumpToParentNormal', u'%s ORGMODE.plugins[u"Navigator"].parent(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Up', self.keybindings[-1]) self.keybindings.append(Keybinding(u'g}', Plug('OrgJumpToParentsSiblingNormal', u'%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Down', self.keybindings[-1]) self.keybindings.append(Keybinding(u'{', Plug(u'OrgJumpToPreviousNormal', u'%s ORGMODE.plugins[u"Navigator"].previous(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Previous', self.keybindings[-1]) self.keybindings.append(Keybinding(u'}', Plug(u'OrgJumpToNextNormal', u'%s ORGMODE.plugins[u"Navigator"].next(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Next', self.keybindings[-1]) # visual mode self.keybindings.append(Keybinding(u'g{', Plug(u'OrgJumpToParentVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].parent(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append(Keybinding(u'g}', Plug('OrgJumpToParentsSiblingVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append(Keybinding(u'{', Plug(u'OrgJumpToPreviousVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append(Keybinding(u'}', Plug(u'OrgJumpToNextVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) # operator-pending mode self.keybindings.append(Keybinding(u'g{', Plug(u'OrgJumpToParentOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].parent(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append(Keybinding(u'g}', Plug('OrgJumpToParentsSiblingOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append(Keybinding(u'{', Plug(u'OrgJumpToPreviousOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append(Keybinding(u'}', Plug(u'OrgJumpToNextOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) # section wise movement (skip children) # normal mode self.keybindings.append(Keybinding(u'[[', Plug(u'OrgJumpToPreviousSkipChildrenNormal', u'%s ORGMODE.plugins[u"Navigator"].previous(mode=u"normal", skip_children=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Ne&xt Same Level', self.keybindings[-1]) self.keybindings.append(Keybinding(u']]', Plug(u'OrgJumpToNextSkipChildrenNormal', u'%s ORGMODE.plugins[u"Navigator"].next(mode=u"normal", skip_children=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Pre&vious Same Level', self.keybindings[-1]) # visual mode self.keybindings.append(Keybinding(u'[[', Plug(u'OrgJumpToPreviousSkipChildrenVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"visual", skip_children=True)<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append(Keybinding(u']]', Plug(u'OrgJumpToNextSkipChildrenVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"visual", skip_children=True)<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) # operator-pending mode self.keybindings.append(Keybinding(u'[[', Plug(u'OrgJumpToPreviousSkipChildrenOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"operator", skip_children=True)<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append(Keybinding(u']]', Plug(u'OrgJumpToNextSkipChildrenOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"operator", skip_children=True)<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR)))
def register(self): u""" Registration of plugin. Key bindings and other initialization should be done. """ # EditStructure related default settings settings.set(u'org_improve_split_heading', u'1') # EditStructure related keybindings self.keybindings.append( Keybinding( u'<C-S-CR>', Plug( u'OrgNewHeadingAboveNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(below=False)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'New Heading &above', self.keybindings[-1]) self.keybindings.append( Keybinding(u'<localleader>hN', u'<Plug>OrgNewHeadingAboveNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'<localleader><CR>', u'<Plug>OrgNewHeadingAboveNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'<S-CR>', Plug( u'OrgNewHeadingBelowNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(below=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'New Heading &below', self.keybindings[-1]) self.keybindings.append( Keybinding(u'<localleader>hh', u'<Plug>OrgNewHeadingBelowNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'<leader><CR>', u'<Plug>OrgNewHeadingBelowNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'<C-CR>', Plug( u'OrgNewHeadingBelowAfterChildrenNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(below=True, end_of_last_child=True)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'New Heading below, after &children', self.keybindings[-1]) self.keybindings.append( Keybinding(u'<localleader>hn', u'<Plug>OrgNewHeadingBelowAfterChildrenNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'<CR>', u'<Plug>OrgNewHeadingBelowAfterChildrenNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'<C-S-CR>', Plug( u'OrgNewHeadingAboveInsert', u'<C-o>:<C-u>silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(below=False, insert_mode=True)<CR>' % VIM_PY_CALL, mode=MODE_INSERT))) self.keybindings.append( Keybinding( u'<S-CR>', Plug( u'OrgNewHeadingBelowInsert', u'<C-o>:<C-u>silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(below=True, insert_mode=True)<CR>' % VIM_PY_CALL, mode=MODE_INSERT))) self.keybindings.append( Keybinding( u'<C-CR>', Plug( u'OrgNewHeadingBelowAfterChildrenInsert', u'<C-o>:<C-u>silent! %s ORGMODE.plugins[u"EditStructure"].new_heading(insert_mode=True, end_of_last_child=True)<CR>' % VIM_PY_CALL, mode=MODE_INSERT))) self.menu + Separator() self.keybindings.append( Keybinding( u'm{', Plug( u'OrgMoveHeadingUpward', u'%s ORGMODE.plugins[u"EditStructure"].move_heading_upward(including_children=False)<CR>' % VIM_PY_CALL))) self.keybindings.append( Keybinding( u'm[[', Plug( u'OrgMoveSubtreeUpward', u'%s ORGMODE.plugins[u"EditStructure"].move_heading_upward()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Move Subtree &Up', self.keybindings[-1]) self.keybindings.append( Keybinding( u'm}', Plug( u'OrgMoveHeadingDownward', u'%s ORGMODE.plugins[u"EditStructure"].move_heading_downward(including_children=False)<CR>' % VIM_PY_CALL))) self.keybindings.append( Keybinding( u'm]]', Plug( u'OrgMoveSubtreeDownward', u'%s ORGMODE.plugins[u"EditStructure"].move_heading_downward()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'Move Subtree &Down', self.keybindings[-1]) self.menu + Separator() self.menu + ActionEntry(u'&Copy Heading', u'yah', u'yah') self.menu + ActionEntry(u'C&ut Heading', u'dah', u'dah') self.menu + Separator() self.menu + ActionEntry(u'&Copy Subtree', u'yar', u'yar') self.menu + ActionEntry(u'C&ut Subtree', u'dar', u'dar') self.menu + ActionEntry(u'&Paste Subtree', u'p', u'p') self.menu + Separator() self.keybindings.append( Keybinding( u'<ah', Plug( u'OrgPromoteHeadingNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].promote_heading(including_children=False)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Promote Heading', self.keybindings[-1]) self.keybindings.append( Keybinding( u'<<', Plug( u'OrgPromoteOnHeadingNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].promote_heading(including_children=False, on_heading=True)<CR>' % VIM_PY_CALL))) self.keybindings.append( Keybinding(u'<{', u'<Plug>OrgPromoteHeadingNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'<ih', u'<Plug>OrgPromoteHeadingNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'<ar', Plug( u'OrgPromoteSubtreeNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].promote_heading()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Promote Subtree', self.keybindings[-1]) self.keybindings.append( Keybinding(u'<[[', u'<Plug>OrgPromoteSubtreeNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'<ir', u'<Plug>OrgPromoteSubtreeNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'>ah', Plug( u'OrgDemoteHeadingNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].demote_heading(including_children=False)<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Demote Heading', self.keybindings[-1]) self.keybindings.append( Keybinding( u'>>', Plug( u'OrgDemoteOnHeadingNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].demote_heading(including_children=False, on_heading=True)<CR>' % VIM_PY_CALL))) self.keybindings.append( Keybinding(u'>}', u'<Plug>OrgDemoteHeadingNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'>ih', u'<Plug>OrgDemoteHeadingNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding( u'>ar', Plug( u'OrgDemoteSubtreeNormal', u':silent! %s ORGMODE.plugins[u"EditStructure"].demote_heading()<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Demote Subtree', self.keybindings[-1]) self.keybindings.append( Keybinding(u'>]]', u'<Plug>OrgDemoteSubtreeNormal', mode=MODE_NORMAL)) self.keybindings.append( Keybinding(u'>ir', u'<Plug>OrgDemoteSubtreeNormal', mode=MODE_NORMAL)) # other keybindings self.keybindings.append( Keybinding( u'<C-d>', Plug( u'OrgPromoteOnHeadingInsert', u'<C-o>:silent! %s ORGMODE.plugins[u"EditStructure"].promote_heading(including_children=False, on_heading=True, insert_mode=True)<CR>' % VIM_PY_CALL, mode=MODE_INSERT))) self.keybindings.append( Keybinding( u'<C-t>', Plug( u'OrgDemoteOnHeadingInsert', u'<C-o>:silent! %s ORGMODE.plugins[u"EditStructure"].demote_heading(including_children=False, on_heading=True, insert_mode=True)<CR>' % VIM_PY_CALL, mode=MODE_INSERT)))
def register(self): # normal mode self.keybindings.append( Keybinding( u'g{', Plug( 'OrgJumpToParentNormal', u'%s ORGMODE.plugins[u"Navigator"].parent(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Up', self.keybindings[-1]) self.keybindings.append( Keybinding( u'g}', Plug( 'OrgJumpToParentsSiblingNormal', u'%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Down', self.keybindings[-1]) self.keybindings.append( Keybinding( u'{', Plug( u'OrgJumpToPreviousNormal', u'%s ORGMODE.plugins[u"Navigator"].previous(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Previous', self.keybindings[-1]) self.keybindings.append( Keybinding( u'}', Plug( u'OrgJumpToNextNormal', u'%s ORGMODE.plugins[u"Navigator"].next(mode=u"normal")<CR>' % VIM_PY_CALL))) self.menu + ActionEntry(u'&Next', self.keybindings[-1]) # visual mode self.keybindings.append( Keybinding( u'g{', Plug( u'OrgJumpToParentVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].parent(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append( Keybinding( u'g}', Plug( 'OrgJumpToParentsSiblingVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append( Keybinding( u'{', Plug( u'OrgJumpToPreviousVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) self.keybindings.append( Keybinding( u'}', Plug( u'OrgJumpToNextVisual', u'<Esc>:<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"visual")<CR>' % VIM_PY_CALL, mode=MODE_VISUAL))) # operator-pending mode self.keybindings.append( Keybinding( u'g{', Plug( u'OrgJumpToParentOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].parent(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append( Keybinding( u'g}', Plug( 'OrgJumpToParentsSiblingOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].parent_next_sibling(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append( Keybinding( u'{', Plug( u'OrgJumpToPreviousOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].previous(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR))) self.keybindings.append( Keybinding( u'}', Plug( u'OrgJumpToNextOperator', u':<C-u>%s ORGMODE.plugins[u"Navigator"].next(mode=u"operator")<CR>' % VIM_PY_CALL, mode=MODE_OPERATOR)))