Anonymous avatar Anonymous committed e25f827

added shortcuts

Comments (0)

Files changed (1)

 variables = {'ropevim_enable_autoimport': 1,
              'ropevim_autoimport_underlineds': 0,
              'ropevim_codeassist_maxfixes' : 1,
-             'ropevim_separate_doc_buffer' : 1,
+             'ropevim_enable_shortcuts' : 1,
              'ropevim_autoimport_modules': '""',
              'ropevim_confirm_saving': 0,
              'ropevim_local_prefix': '"<C-c>r"',
              'ropevim_global_prefix': '"<C-x>p"'}
 
+shortcuts = {'code_assist': '<M-/>',
+             'lucky_assist': '<M-?>',
+             'goto_definition': '<C-c>g',
+             'show_doc': '<C-c>d',
+             'find_occurrences': '<C-c>f'}
+
 def _init_variables():
     for variable, default in variables.items():
         vim.command('if !exists("g:%s")\n' % variable +
                     '  let g:%s = %s\n' % (variable, default))
 
+def _enable_shortcuts():
+    if VIMUtils().get('enable_shortcuts'):
+        for command, shortcut in shortcuts.items():
+            vim.command('map %s :call %s()<cr>' %
+                        (shortcut, _vim_name(command)))
+
 ropemode.decorators.logger.message = echo
 _init_variables()
 _interface = ropemode.interface.RopeMode(env=VIMUtils())
 _interface.init()
+_enable_shortcuts()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.