Exemplo n.º 1
0
    def __init__(self):

        self.tags = {
            'form': 'form',
            'button': 'button',
            'div': 'div',
            'body': 'body',
            'head': 'head',
            'paragraph': 'p',
            'list item': 'li',
        }

        self.attrs = [
            'class',
            'id',
            'type',
            'role',
            'action',
        ]

        super().__init__()
        self.mapping = {
        '<hom_mark> <hom_link>': '<a href="">{left}{left}',
        '<hom_mark> <hom_close> <hom_div>': '</div>',
        '<hom_mark> <hom_tag>': '<>{left}',
        '<hom_mark> {} [<hom_close>]'.format(baseutils.list_to_rule_string(self.tags)): self.tag,
        '<hom_mark> {}'.format(baseutils.list_to_rule_string(self.attrs)): self.create_attribute,
        }
Exemplo n.º 2
0
 def __init__(self):
     super().__init__()
     self.dictionary = baseutils.ALPHABET
     self.mapping = {
         "[<hom_grow>] {} [<num>]".format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.letters,
         "capital [{} [<num>]] ".format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.capital_on,
         "labor [{} [<num>]]".format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.capital_off,
     }
     self.capital = False
Exemplo n.º 3
0
 def __init__(self):
     super().__init__()
     self.dictionary = baseutils.ALPHABET
     self.mapping = {
         '[<hom_grow>] {} [<num>]'.format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.letters,
         'capital [{} [<num>]] '.format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.capital_on,
         'labor [{} [<num>]]'.format(baseutils.list_to_rule_string(baseutils.ALPHABET, True)): self.capital_off,
     }
     self.capital = False
Exemplo n.º 4
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '<hom_list>':
         'ls | cat -n{enter}',
         '<hom_drop> [<num>]':
         self.drop,
         '<hom_climb> [<num>]':
         self.climb,
         '(<hom_left> | <hom_right>) [<num>]':
         self.left_right,
         'new tab':
         '{ctrl+shift+t}',
         'explore':
         'caja .{enter}',
         'refresh':
         self.refresh,
         '(<hom_high> | <hom_low>) [<num>]':
         self.up_down,
         '<hom_terminate>':
         '{ctrl+c}',
         '<hom_git> <hom_initialize>':
         'git init{enter}',
         '<hom_paste>':
         '{ctrl+shift+v}',
         '<hom_jump> {}'.format(
             baseutils.list_to_rule_string(baseutils.PATHS)):
         self.goto_path,
         '<hom_atom>':
         'atom ',
         '<hom_make> <hom_dear>':
         'mkdir ',
     }
Exemplo n.º 5
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '(<hom_debug>|to bug)': self.debug,
         '{} (<hom_function> | <hom_class>)'.format(
             baseutils.list_to_rule_string(au.ACTIONS)): self.modify_function,
     }
Exemplo n.º 6
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '[<hom_short>] {} [<num>]'.format(
             baseutils.list_to_rule_string(baseutils.OPERATORS)):
         self.operator,
     }
Exemplo n.º 7
0
    def __init__(self):
        super().__init__()
        self.goto_rule_pieces = [
            '({}) [<num>]'.format(' | '.join([
                baseutils.homify_text(m) for m in vimutils.motions
                if m not in vimutils.make_outer_list(vimutils.text_objects)
            ])),
            '(<hom_blue> | <hom_fish> | <hom_bill> | <hom_till> | until) ([<hom_grow>] {} | {}) [<num>]'
            .format(baseutils.list_to_rule_string(list(baseutils.ALPHABET)),
                    baseutils.list_to_rule_string(list(baseutils.CHAR_MAP))),
            '(<hom_climb> | <hom_drop>) [<num>]',
            '<hom_matching>',
        ]
        self.motion_rule_pieces = [
            '{} [<num>]'.format(
                baseutils.list_to_rule_string(list(vimutils.motions))),
            '<num> [(<hom_fish> | to | <hom_through>) <num>]',
            baseutils.list_to_rule_string(list(vimutils.single_motions)),
            '(<hom_blue> | <hom_fish> | <hom_bill> | <hom_till> | <hom_until>) ([<hom_grow>] {} | {}) [<num>]'
            .format(baseutils.list_to_rule_string(list(baseutils.ALPHABET)),
                    baseutils.list_to_rule_string(list(baseutils.CHAR_MAP))),
            '<hom_mint> <num>',
        ]

        self.mapping = {
            '({})'.format(' | '.join(self.goto_rule_pieces)):
            self.goto,
            '(<hom_line> | <hom_lend>) <num>':
            self.goto_line,
            '(<hom_grab> | <hom_copy> | <hom_kill> | <hom_select>) ({})'.format(' | '.join(self.motion_rule_pieces)):
            self.movement_func,
            '(<hom_grab> | <hom_copy> | <hom_kill> | <hom_select>) <end>':
            self.single_action,
            '<hom_surround> ({0}) ({1})'.format(
                ' | '.join(self.motion_rule_pieces),
                baseutils.list_to_rule_string(list(vimutils.text_objects))):
            self.surround,
            '<hom_scramble> ({0}) ({0})'.format(
                baseutils.list_to_rule_string(list(vimutils.text_objects))):
            self.surround_change,
            'remove {}'.format(
                baseutils.list_to_rule_string(list(vimutils.text_objects))):
            self.surround_remove,
            '<hom_paste> [<hom_strip>] [(<num> | (<hom_climb> | <hom_drop>) [<num>])]':
            self.paste,
            'clear':
            '{escape}^"_Da',
            '<num> <hom_touch> <num> [(<hom_grab> | <hom_copy> | <hom_kill> | <hom_select>)]':
            self.goto_word_num,
            'inch':
            self.paste_block,
        }
Exemplo n.º 8
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '{} <any> <1->'.format(
             baseutils.list_to_rule_string(baseutils.VARIABLE_TYPES)):
         self.word_sep,
     }
     self.settings['filtered words'] = []
Exemplo n.º 9
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '(<hom_debug>|to bug)':
         self.debug,
         '{} (<hom_function> | <hom_class>)'.format(
             baseutils.list_to_rule_string(au.ACTIONS)):
         self.modify_function,
     }
Exemplo n.º 10
0
 def __init__(self):
     super().__init__()
     self.settings['filtered words'].append('to')
     self.dictionary = baseutils.ALPHABET
     self.mapping = {
         '<hom_macro> <hom_record> {}'.format(baseutils.list_to_rule_string(baseutils.ALPHABET)): self.record_macro,
         '<hom_macro> <hom_save>': self.save_macros,
     }
     self.settings['filtered words'].append('and')
Exemplo n.º 11
0
    def __init__(self):
        super().__init__()
        self.mapping = {
            "<hom_index> [[(minus | negative)] <num>]": self.index,
            "<hom_comment> [<num> [<hom_fish> <num>]]": self.comment,
            "<hom_change> {0} {0}".format(baseutils.list_to_rule_string(baseutils.ALPHABET)): self.change,
            "(<hom_increase> | <hom_decrease>) [<num>]": self.increment,
        }

        self.dictionary = baseutils.ALPHABET
Exemplo n.º 12
0
 def __init__(self):
     super().__init__()
     self.settings['filtered words'].append('to')
     self.dictionary = baseutils.ALPHABET
     self.mapping = {
         '<hom_macro> <hom_record> {}'.format(
             baseutils.list_to_rule_string(baseutils.ALPHABET)):
         self.record_macro,
         '<hom_macro> <hom_save>':
         self.save_macros,
     }
     self.settings['filtered words'].append('and')
Exemplo n.º 13
0
    def __init__(self):
        super().__init__()
        self.mapping = {
            '<hom_index> [[(minus | negative)] <num>]':
            self.index,
            '<hom_comment> [<num> [<hom_fish> <num>]]':
            self.comment,
            '<hom_change> {0} {0}'.format(
                baseutils.list_to_rule_string(baseutils.ALPHABET)):
            self.change,
            '(<hom_increase> | <hom_decrease>) [<num>]':
            self.increment,
        }

        self.dictionary = baseutils.ALPHABET
Exemplo n.º 14
0
 def __init__(self):
     super().__init__()
     self.mapping = {
     '<hom_list>': 'ls | cat -n{enter}',
     '<hom_drop> [<num>]': self.drop,
     '<hom_climb> [<num>]': self.climb,
     '(<hom_left> | <hom_right>) [<num>]': self.left_right,
     'new tab': '{ctrl+shift+t}',
     'explore': 'caja .{enter}',
     'refresh': self.refresh,
     '(<hom_high> | <hom_low>) [<num>]': self.up_down,
     '<hom_terminate>': '{ctrl+c}',
     '<hom_git> <hom_initialize>': 'git init{enter}',
     '<hom_paste>': '{ctrl+shift+v}',
     '<hom_jump> {}'.format(baseutils.list_to_rule_string(baseutils.PATHS)): self.goto_path,
     '<hom_atom>': 'atom ',
     '<hom_make> <hom_dear>': 'mkdir ',
     }
Exemplo n.º 15
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '{} [<num>]'.format(baseutils.list_to_rule_string(baseutils.CHAR_MAP)): self.print_char,
     }
Exemplo n.º 16
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '[{}]{}[<num>]'.format(baseutils.list_to_rule_string(atomutils.ACTIONS),
                                baseutils.list_to_rule_string(atomutils.MOTIONS)): self.do_motion,
         '{} (<hom_beer> | <hom_line>)'.format(baseutils.list_to_rule_string(atomutils.ACTIONS)): self.line_action,
         '{} [<hom_outer>] {}'.format(baseutils.list_to_rule_string(atomutils.ACTIONS),
                     baseutils.list_to_rule_string(atomutils.SURROUND_OBJECTS)): self.do_surround,
         '{} [<hom_outer>] {}'.format(baseutils.list_to_rule_string(atomutils.ACTIONS),
                     baseutils.list_to_rule_string(atomutils.STRING_OBJECTS)): self.do_surround_same,
         '[{}] {} {} [<num>]'.format(baseutils.list_to_rule_string(atomutils.ACTIONS),
                        baseutils.list_to_rule_string(atomutils.INCREMENTAL_LIMITS),
                        baseutils.list_to_rule_string(list(self.search_chars))): self.incremental_search,
         '(<hom_beer> | <hom_line> | <hom_grab> | <hom_copy> | <hom_kill> | <hom_select>) <num>': self.single_line,
         '[{}] {} <hom_grow> {} [<num>]'.format(baseutils.list_to_rule_string(atomutils.ACTIONS),
                                                baseutils.list_to_rule_string(atomutils.INCREMENTAL_LIMITS),
                                                baseutils.list_to_rule_string(baseutils.ALPHABET)): self.upper_incremental,
         '[{}] fisher-price [<num>]'.format(baseutils.list_to_rule_string(atomutils.ACTIONS)): self.fisher_price,
         'copyleft [<num>]': self.copyleft,
         '{} <hom_word>'.format(baseutils.list_to_rule_string(atomutils.ACTIONS)): self.single_word,
         '[{}] <hom_search> <any> <1->'.format(baseutils.list_to_rule_string(atomutils.ACTIONS)): self.search_ahead,
     }
Exemplo n.º 17
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '{} <any> <1->'.format(baseutils.list_to_rule_string(baseutils.VARIABLE_TYPES)): self.word_sep,
     }
     self.settings['filtered words'] = []
Exemplo n.º 18
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '[{}]{}[<num>]'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS),
             baseutils.list_to_rule_string(atomutils.MOTIONS)):
         self.do_motion,
         '{} (<hom_beer> | <hom_line>)'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS)):
         self.line_action,
         '{} [<hom_outer>] {}'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS),
             baseutils.list_to_rule_string(atomutils.SURROUND_OBJECTS)):
         self.do_surround,
         '{} [<hom_outer>] {}'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS),
             baseutils.list_to_rule_string(atomutils.STRING_OBJECTS)):
         self.do_surround_same,
         '[{}] {} {} [<num>]'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS),
             baseutils.list_to_rule_string(atomutils.INCREMENTAL_LIMITS),
             baseutils.list_to_rule_string(list(self.search_chars))):
         self.incremental_search,
         '(<hom_beer> | <hom_line> | <hom_grab> | <hom_copy> | <hom_kill> | <hom_select>) <num>':
         self.single_line,
         '[{}] {} <hom_grow> {} [<num>]'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS),
             baseutils.list_to_rule_string(atomutils.INCREMENTAL_LIMITS),
             baseutils.list_to_rule_string(baseutils.ALPHABET)):
         self.upper_incremental,
         '[{}] fisher-price [<num>]'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS)):
         self.fisher_price,
         'copyleft [<num>]':
         self.copyleft,
         '{} <hom_word>'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS)):
         self.single_word,
         '[{}] <hom_search> <any> <1->'.format(
             baseutils.list_to_rule_string(atomutils.ACTIONS)):
         self.search_ahead,
     }
Exemplo n.º 19
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '[<hom_short>] {} [<num>]'.format(baseutils.list_to_rule_string(vimutils.OPERATORS)): self.operator,
     }