Пример #1
0
	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'OrgDateInsertTimestampActiveCmdLine',
				u':py ORGMODE.plugins[u"Date"].insert_timestamp()<CR>')))
		self.menu + ActionEntry(u'Timest&amp', self.keybindings[-1])

		self.keybindings.append(Keybinding(u'<localleader>si',
				Plug(u'OrgDateInsertTimestampInactiveCmdLine',
					u':py ORGMODE.plugins[u"Date"].insert_timestamp(False)<CR>')))
		self.menu + ActionEntry(u'Timestamp (&inactive)', self.keybindings[-1])

		self.keybindings.append(Keybinding(u'<localleader>pa',
				Plug(u'OrgDateInsertTimestampActiveWithCalendar',
				u':py ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar()<CR>')))
		self.menu + ActionEntry(u'Timestamp with Calendar', self.keybindings[-1])

		self.keybindings.append(Keybinding(u'<localleader>pi',
				Plug(u'OrgDateInsertTimestampInactiveWithCalendar',
					u':py ORGMODE.plugins[u"Date"].insert_timestamp_with_calendar(False)<CR>')))
		self.menu + ActionEntry(u'Timestamp with Calendar(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>')
Пример #2
0
    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'])
Пример #3
0
    def __init__(self):
        u""" Initialize plugin """
        object.__init__(self)
        # menu entries this plugin should create
        self.menu = ORGMODE.orgmenu + Submenu(u'Dates and Scheduling')

        # key bindings for this plugin
        # key bindings are also registered through the menu so only additional
        # bindings should be put in this variable
        self.keybindings = []

        # commands for this plugin
        self.commands = []

        # set speeddating format that is compatible with orgmode
        try:
            if int(vim.eval(u'exists(":SpeedDatingFormat")'.encode(u'utf-8'))):
                vim.command(
                    u':1SpeedDatingFormat %Y-%m-%d %a'.encode(u'utf-8'))
                vim.command(
                    u':1SpeedDatingFormat %Y-%m-%d %a %H:%M'.encode(u'utf-8'))
            else:
                echom(u'Speeddating plugin not installed. Please install it.')
        except:
            echom(u'Speeddating plugin not installed. Please install it.')
Пример #4
0
    def register(self):
        u"""
		Registration of the plugin.

		Key bindings and other initialization should be done here.
		"""
        settings.set(u'org_leader', u',')
        leader = settings.get(u'org_leader', u',')

        self.keybindings.append(
            Keybinding(
                u'%ssa' % leader,
                Plug(u'OrgDateInsertTimestampActive',
                     u':py ORGMODE.plugins[u"Date"].insert_timestamp()<CR>')))
        self.menu + ActionEntry(u'Timest&amp', self.keybindings[-1])

        self.keybindings.append(
            Keybinding(
                u'%ssi' % leader,
                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>')
Пример #5
0
    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'))
Пример #6
0
    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&amp')
        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>')
Пример #7
0
    def __init__(self):
        u""" Initialize plugin """
        object.__init__(self)
        # menu entries this plugin should create
        self.menu = ORGMODE.orgmenu + Submenu(u'&TODO Lists')

        # key bindings for this plugin
        # key bindings are also registered through the menu so only additional
        # bindings should be put in this variable
        self.keybindings = []
Пример #8
0
    def __init__(self):
        """ Initialize plugin """
        object.__init__(self)
        # menu entries this plugin should create
        self.menu = ORGMODE.orgmenu + Submenu('Dates and Scheduling')

        # key bindings for this plugin
        # key bindings are also registered through the menu so only additional
        # bindings should be put in this variable
        self.keybindings = []

        # commands for this plugin
        self.commands = []
Пример #9
0
	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>')
Пример #10
0
 def __init__(self):
     object.__init__(self)
     self.menu = ORGMODE.orgmenu + Submenu(u'&Navigate Headings')
     self.keybindings = []