예제 #1
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '(<hom_grab> | <hom_copy> | <hom_kill> | <hom_select>) <num> (<hom_through> | <hom_fish>) <num>':
         self.multiple_lines,
         '<hom_lob> [<num>]': ['{ctrl+l}',
                               dynamic.Num().add(-1)]
     }
     self.settings['priority'] = 2
예제 #2
0
 def _finish_recording_macros(self):
     new_rules = []
     for rule_name, macro in self._recording_macros.items():
         rule_name = '{} [<num>]'.format(rule_name)
         new_rules.append(
             ruleparser.Rule(rule_name,
                             macro[:-1] + [dynamic.Num(-1).add(-1)], self))
     for rule in self._rules:
         if rule.pattern_text not in [r.pattern_text for r in new_rules]:
             new_rules.append(rule)
     self._rules = new_rules
     self._recording_macros = {}
예제 #3
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '<hom_nerd> <hom_line> <num>': [dynamic.Num(integer=False), 'gg'],
         '<hom_nerd> new [<num>]': self.new_child,
         '<hom_nerd> [to] <hom_bookmarks>': 'B',
         '<hom_nerd> [to] <hom_create>': '{enter}{enter}i',
         '<hom_nerd> [to] delete': 'mdy',
         '<hom_nerd> [to] vertical': 'v',
         '<hom_nerd> [to] horizontal': 'i',
         '<hom_nerd> [to] refresh': 'R',
         '<hom_nerd> [to] (parent | parents)': 'p',
         '<hom_nerd> [to] <hom_root>': 'P',
         '<hom_nerd> [to] close': 'x',
         '<hom_nerd> [to] <hom_climb>': 'u',
         '<hom_nerd> [to] <num> enter': [dynamic.Num(integer=False), 'gg{enter}'],
         '<hom_poke> [to] <num>': [dynamic.Num(integer=False), 'gg{enter}'],
         'focalin': '11gg{enter}',
         '<hom_nerd> (<hom_django> | <hom_modules> | <hom_root> | <hom_home> | <hom_python>)': self.go_to_dir,
         '<hom_nerd> [to] <hom_copy>': 'mc',
         '<hom_nerd> [to] <hom_toggle>': '{esc}:NERDTreeToggle{enter}',
     }
예제 #4
0
 def __init__(self):
     super().__init__()
     self.settings['filtered words'] = []
     self.mapping = {
         '(<hom_enter> | <hom_slap>) [<num>]':
         ['{enter}', dynamic.Num().add(-1)],
         '<hom_leap>':
         '{tab}',
         'space':
         ' ',
         '(escape | out)':
         '{escape}',
         '<hom_job> [<num>]': ['{backspace}',
                               dynamic.Num().add(-1)],
         '<hom_tell> [<num>]': ['{delete}',
                                dynamic.Num().add(-1)],
         '<hom_open> <any> <1->':
         self.open_window,
         '(<hom_num> | number) <num>':
         self.number,
         '<hom_start> <any> <1->':
         self.launch_program,
         '<hom_kill> program':
         '{alt+F4}',
         'maximize':
         '{alt+F10}',
         'minimize':
         '{alt+F9}',
         '<hom_repeat> [<num>]':
         [dynamic.RepeatCommand(count=dynamic.Num(default=1))],
         '<hom_again> [<num>]':
         dynamic.Num(default=1),
         '<hom_negative> <num>':
         self.negative_num,
     }
     self.settings['priority'] = 4
예제 #5
0
    def __init__(self):
        super().__init__()
        self.app_context = 'vimperator'
        self.mapping = {
            '<hom_high>':
            '{escape}{escape}{ctrl+b}',
            '(<hom_low> | below)':
            '{escape}{escape}{space}',
            '<hom_back> [<num>]': ['{escape}{shift+h}',
                                   dynamic.Num().add(-1)],
            '<hom_next>':
            '{escape}{shift+l}',
            '<hom_link>':
            '{escape}{escape}f',
            '<hom_new> <hom_link>':
            '{escape}{escape}{shift+f}',
            'spectacular':
            '{ctrl+l}{backspace}',
            '<hom_copy> url':
            self.copy_url,
            '(<hom_right> | <hom_left>) [<num>]':
            self.change_tab,
            'left [<num>]': ['{escape}gT', dynamic.Num().add(-1)],
            'close <end>':
            '{esc}{esc}{ctrl+w}',
            'new tab':
            '{escape}{ctrl+t}',
            '{}':
            self.goto_url,
            'top':
            '{escape}gg',
            'bottom':
            '{escape}G',
            'refresh':
            '{F5}',
            '<num>':
            self.number,
            '<hom_run> <hom_django>':
            '{esc}{esc}{ctrl+l}http://127.0.0.1:8000/{enter}',
        }

        self.dictionary = {
            'google':
            'google.com',
            'news':
            'news.google.com',
            'reddit':
            'reddit.com',
            'read it':
            'reddit.com',
            'red it':
            'reddit.com',
            'read':
            'reddit.com',
            'something awful':
            'forums.somethingawful.com',
            'gmail':
            'gmail.com',
            'meet up':
            'meetup.com',
            'compose email':
            'https://mail.google.com/mail/u/0/#inbox?compose=new',
            'weather':
            'weather.gov',
            'local weather':
            'http://forecast.weather.gov/MapClick.php?lat=40.8493278056348&lon=-73.93575753168392&site=all&smap=1',
        }
예제 #6
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '<hom_nerd> <hom_line> <num>': [dynamic.Num(integer=False), 'gg'],
         '<hom_nerd> new [<num>]': self.new_child,
     }
예제 #7
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '<hom_vim> <hom_refresh>':
         '{esc}:so $MYVIMRC{enter}a',
         '<hom_wave>':
         '{F8}{escape}$a:zz{enter}',
         '<hom_stop>':
         '{escape}o{left}{left}{left}{left}',
         '<hom_speak>':
         "print(''){left}{left}",
         'otherwise':
         'else:{enter}',
         '<hom_braces>':
         '{{}}',
         '<hom_scope>':
         '{{}}{left}{enter}{backspace}{enter}{esc}{alt+7}{up}$a{back}{back}{back}',
         '<hom_pair>':
         '()',
         '<hom_call>':
         '(){left}',
         '<hom_block>':
         '[]',
         '<hom_index>':
         '[]{left}',
         '<hom_dict>':
         'dict',
         '<hom_show>':
         'print(){left}',
         '<hom_carb>':
         '{escape}f(a',
         '<hom_join> <hom_line>':
         'J',
         '<hom_string>':
         "''{left}",
         '<hom_link>':
         ': ',
         '<hom_tab>':
         '{tab}',
         '<hom_sleeve>':
         "{esc}be{right}a, ''{left}",
         '<hom_straight>':
         '{esc}^i.{esc}' + vimutils.FUNCTIONS['AlignWithAbove'] + 'a{del}',
         '<hom_bow> [<num>]': ['{alt+h}', dynamic.Num().add(-1)],
         '<hom_shield> [<num>]': ['{alt+l}',
                                  dynamic.Num().add(-1)],
         '<hom_dell> [<num>]': ['{del}', dynamic.Num().add(-1)],
         '<hom_punch> [<num>]': ['{F2}"_ciw'],
         '<hom_brain> [<num>]': ['{F2}yiwea'],
         '<hom_green> [<num>]':
         ['{esc}', dynamic.Num(default=1, integer=False), '"_ddi'],
         '<hom_fuzzy>':
         '{F11}:CtrlP{enter}',
         '<hom_new> <hom_buffer>':
         '{esc}:enew!{enter}i',
         '<hom_sort> <end>':
         'sort',
         '<hom_care>':
         'char',
         '<hom_swap> <hom_line>':
         '{esc}ddpi',
         '(<hom_viewport> | view port) <hom_close>':
         '{esc}:tabclose!{enter}',
         '(<hom_viewport> | view port) <hom_new>':
         '{esc}:tabe!{enter}',
         '(<hom_viewport> | view port) <hom_left>':
         '{esc}gTa',
         '(<hom_viewport> | view port) <hom_right>':
         '{esc}gta',
         '<hom_swap> <hom_drop>':
         '{esc}ddpa',
         '(<hom_viewport> | view port) <hom_new>':
         '{esc}:tabe!{enter}',
         '(<hom_viewport> | view port) <hom_left>':
         '{esc}gTa',
         '(<hom_viewport> | view port) <hom_right>':
         '{esc}gta',
         '<hom_swap> <hom_climb>':
         '{esc}ddkPa',
         '(<hom_duplicate> | <hom_dupe>) [<hom_below>]':
         '{esc}yy$pi',
         '(<hom_duplicate> | <hom_dupe>) <hom_above>':
         '{esc}yy0Pi',
         '<hom_capitalize>':
         '{F2}{left}eb~{left}i',
         '<hom_display> [<hom_line>] (number | numbers)':
         '{esc}:set nu{enter}a',
         '<hom_elephant>':
         '{esc}mba{ctrl+v}{esc}' + vimutils.FUNCTIONS['DeleteLineIfEmpty'] +
         'mc`b^i.{esc}' + vimutils.FUNCTIONS['AlignWithAbove'] +
         '{del}`c$a',
     }
예제 #8
0
 def __init__(self):
     super().__init__()
     self.mapping = {
         '<hom_atom> <hom_refresh>':
         '{ctrl+alt+r}',
         '<hom_scratch> [<num>]': ['{ctrl+z}',
                                   dynamic.Num().add(-1)],
         '<hom_redo> [<num>]': ['{ctrl+y}',
                                dynamic.Num().add(-1)],
         '<hom_save>':
         '{ctrl+s}',
         '<hom_debug> <hom_panel>':
         '{ctrl+shift+i}',
         '<hom_clear> (<hom_select>|<hom_selection>)':
         au.OTHER['clearSelect'],
         '<hom_wave>':
         au.OTHER['clearSelect'] + '{end}:{enter}',
         '<hom_stop>':
         au.OTHER['clearSelect'] + '{end}{enter}{back}',
         '<hom_braces>':
         '{{}}',
         '<hom_pair>':
         '()',
         '<hom_call>':
         '(){left}',
         '<hom_block>':
         '[]',
         '<hom_index>':
         '[]{left}',
         '<hom_dict>':
         'dict',
         '<hom_show>':
         'print(){left}',
         '<hom_carb>':
         '{escape}f(a',
         '<hom_join> <hom_line>':
         'J',
         '<hom_string>':
         "''{left}",
         '<hom_link>':
         ': ',
         '<hom_tab>':
         '{tab}',
         '<hom_straight>':
         '',
         '<hom_bow> [<num>]': ['{ctrl+[}',
                               dynamic.Num().add(-1)],
         '<hom_shield> [<num>]': ['{ctrl+]}',
                                  dynamic.Num().add(-1)],
         '<hom_dell> [<num>]': ['{del}', dynamic.Num().add(-1)],
         '<hom_punch>':
         au.OTHER['clearSelect'] + '{ctrl+d}{back}',
         '<hom_brain>':
         au.OTHER['clearSelect'] + '{ctrl+d}{ctrl+c}' +
         au.OTHER['clearSelect'],
         '<hom_green> [<num>]':
         self.delete_line,
         '<hom_fuzzy>':
         '{ctrl+t}',
         '<hom_plant> [to] <hom_new>':
         '{ctrl+n}',
         '<hom_plant> [to] <hom_close>':
         '{ctrl+w}',
         '<hom_plant> [to] (<hom_left> | <hom_right>) [<num>]':
         self.tab_direction,
         '<hom_sort> <end>':
         'sort',
         '<hom_care>':
         'char',
         '<hom_climb>':
         '{ctrl+shift+enter}',
         '<hom_drop>':
         '{end}{enter}',
         '(<hom_duplicate> | <hom_dupe>) [<hom_below>]':
         '{ctrl+D}',
         '(<hom_duplicate> | <hom_dupe>) <hom_above>':
         '{up}{ctrl+D}',
         '<hom_high> [<num>]': ['{up}', dynamic.Num().add(-1)],
         '<hom_right> [<num>]': ['{right}',
                                 dynamic.Num().add(-1)],
         '<hom_low> [<num>]': ['{down}', dynamic.Num().add(-1)],
         '<hom_left> [<num>]': ['{left}', dynamic.Num().add(-1)],
         '<hom_punch>':
         au.OTHER['clearSelect'] + '{ctrl+d}{back}',
         '<hom_comment>':
         '{ctrl+alt+Z}',
         '<hom_halt>':
         ', ',
         'selfhood':
         'self.',
         '<hom_swap> <hom_high> [<num>]':
         ['{ctrl+up}', dynamic.Num().add(-1)],
         '<hom_swap> <hom_low> [<num>]':
         ['{ctrl+down}', dynamic.Num().add(-1)],
         '<hom_search>':
         '{ctrl+f}',
         '<hom_bounce>':
         '{F3}',
         '<hom_sequence> <num> <1->':
         self.num_sequence,
         '<hom_grab> <end>':
         '{ctrl+x}',
     }
     self.settings['priority'] = 3