How to use the spyder.config.gui.config_shortcut function in spyder

To help you get started, we’ve selected a few spyder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spyder-ide / spyder / spyder / widgets / ipythonconsole / shell.py View on Github external
def create_shortcuts(self):
        """Create shortcuts for ipyconsole."""
        inspect = config_shortcut(self._control.inspect_current_object,
                                  context='Console',
                                  name='Inspect current object', parent=self)
        clear_console = config_shortcut(self.clear_console, context='Console',
                                        name='Clear shell', parent=self)
        restart_kernel = config_shortcut(self.ipyclient.restart_kernel,
                                         context='ipython_console',
                                         name='Restart kernel', parent=self)
        new_tab = config_shortcut(lambda: self.new_client.emit(),
                                  context='ipython_console', name='new tab',
                                  parent=self)
        reset_namespace = config_shortcut(lambda: self._reset_namespace(),
                                          context='ipython_console',
                                          name='reset namespace', parent=self)
        array_inline = config_shortcut(self._control.enter_array_inline,
                                       context='array_builder',
                                       name='enter array inline', parent=self)
        array_table = config_shortcut(self._control.enter_array_table,
                                      context='array_builder',
                                      name='enter array table', parent=self)
        clear_line = config_shortcut(self.ipyclient.clear_line,
                                     context='console', name='clear line',
github spyder-ide / spyder / spyder / widgets / ipythonconsole / shell.py View on Github external
def create_shortcuts(self):
        """Create shortcuts for ipyconsole."""
        inspect = config_shortcut(self._control.inspect_current_object,
                                  context='Console',
                                  name='Inspect current object', parent=self)
        clear_console = config_shortcut(self.clear_console, context='Console',
                                        name='Clear shell', parent=self)
        restart_kernel = config_shortcut(self.ipyclient.restart_kernel,
                                         context='ipython_console',
                                         name='Restart kernel', parent=self)
        new_tab = config_shortcut(lambda: self.new_client.emit(),
                                  context='ipython_console', name='new tab',
                                  parent=self)
        reset_namespace = config_shortcut(lambda: self._reset_namespace(),
                                          context='ipython_console',
                                          name='reset namespace', parent=self)
        array_inline = config_shortcut(self._control.enter_array_inline,
                                       context='array_builder',
                                       name='enter array inline', parent=self)
        array_table = config_shortcut(self._control.enter_array_table,
                                      context='array_builder',
                                      name='enter array table', parent=self)
github spyder-ide / spyder / spyder / widgets / ipythonconsole / shell.py View on Github external
def create_shortcuts(self):
        """Create shortcuts for ipyconsole."""
        inspect = config_shortcut(self._control.inspect_current_object,
                                  context='Console',
                                  name='Inspect current object', parent=self)
        clear_console = config_shortcut(self.clear_console, context='Console',
                                        name='Clear shell', parent=self)
        restart_kernel = config_shortcut(self.ipyclient.restart_kernel,
                                         context='ipython_console',
                                         name='Restart kernel', parent=self)
        new_tab = config_shortcut(lambda: self.new_client.emit(),
                                  context='ipython_console', name='new tab',
                                  parent=self)
        reset_namespace = config_shortcut(lambda: self._reset_namespace(),
                                          context='ipython_console',
                                          name='reset namespace', parent=self)
        array_inline = config_shortcut(self._control.enter_array_inline,
                                       context='array_builder',
                                       name='enter array inline', parent=self)
        array_table = config_shortcut(self._control.enter_array_table,
                                      context='array_builder',
                                      name='enter array table', parent=self)
        clear_line = config_shortcut(self.ipyclient.clear_line,
                                     context='console', name='clear line',
                                     parent=self)

        return [inspect, clear_console, restart_kernel, new_tab,
                reset_namespace, array_inline, array_table, clear_line]
github spyder-ide / spyder / spyder / plugins / editor / widgets / editor.py View on Github external
nexttab = config_shortcut(lambda: self.tabs.tab_navigate(1),
                                  context='Editor',
                                  name='Cycle to next file', parent=self)
        run_selection = config_shortcut(self.run_selection, context='Editor',
                                        name='Run selection', parent=self)
        new_file = config_shortcut(lambda : self.sig_new_file[()].emit(),
                                   context='Editor', name='New file',
                                   parent=self)
        open_file = config_shortcut(lambda : self.plugin_load[()].emit(),
                                    context='Editor', name='Open file',
                                    parent=self)
        save_file = config_shortcut(self.save, context='Editor',
                                    name='Save file', parent=self)
        save_all = config_shortcut(self.save_all, context='Editor',
                                   name='Save all', parent=self)
        save_as = config_shortcut(lambda : self.sig_save_as.emit(),
                                  context='Editor', name='Save As',
                                  parent=self)
        close_all = config_shortcut(self.close_all_files, context='Editor',
                                    name='Close all', parent=self)
        prev_edit_pos = config_shortcut(lambda : self.sig_prev_edit_pos.emit(),
                                        context="Editor",
                                        name="Last edit location",
                                        parent=self)
        prev_cursor = config_shortcut(lambda : self.sig_prev_cursor.emit(),
                                      context="Editor",
                                      name="Previous cursor position",
                                      parent=self)
        next_cursor = config_shortcut(lambda : self.sig_next_cursor.emit(),
                                      context="Editor",
                                      name="Next cursor position",
                                      parent=self)
github spyder-ide / spyder / spyder / plugins / editor / widgets / editor.py View on Github external
context="Editor",
                                        name="Last edit location",
                                        parent=self)
        prev_cursor = config_shortcut(lambda : self.sig_prev_cursor.emit(),
                                      context="Editor",
                                      name="Previous cursor position",
                                      parent=self)
        next_cursor = config_shortcut(lambda : self.sig_next_cursor.emit(),
                                      context="Editor",
                                      name="Next cursor position",
                                      parent=self)
        zoom_in_1 = config_shortcut(lambda : self.zoom_in.emit(),
                                      context="Editor",
                                      name="zoom in 1",
                                      parent=self)
        zoom_in_2 = config_shortcut(lambda : self.zoom_in.emit(),
                                      context="Editor",
                                      name="zoom in 2",
                                      parent=self)
        zoom_out = config_shortcut(lambda : self.zoom_out.emit(),
                                      context="Editor",
                                      name="zoom out",
                                      parent=self)
        zoom_reset = config_shortcut(lambda: self.zoom_reset.emit(),
                                      context="Editor",
                                      name="zoom reset",
                                      parent=self)
        close_file_1 = config_shortcut(self.close_file,
                                      context="Editor",
                                      name="close file 1",
                                      parent=self)
        close_file_2 = config_shortcut(self.close_file,
github spyder-ide / spyder / spyder / plugins / editor / widgets / editor.py View on Github external
def create_shortcuts(self):
        """Create local shortcuts"""
        # --- Configurable shortcuts
        inspect = config_shortcut(self.inspect_current_object, context='Editor',
                                  name='Inspect current object', parent=self)
        set_breakpoint = config_shortcut(self.set_or_clear_breakpoint,
                                         context='Editor', name='Breakpoint',
                                         parent=self)
        set_cond_breakpoint = config_shortcut(
                                    self.set_or_edit_conditional_breakpoint,
                                    context='Editor',
                                    name='Conditional breakpoint',
                                    parent=self)
        gotoline = config_shortcut(self.go_to_line, context='Editor',
                                   name='Go to line', parent=self)
        tab = config_shortcut(lambda: self.tab_navigation_mru(forward=False),
                              context='Editor',
                              name='Go to previous file', parent=self)
        tabshift = config_shortcut(self.tab_navigation_mru, context='Editor',
                                   name='Go to next file', parent=self)
        prevtab = config_shortcut(lambda: self.tabs.tab_navigate(-1),
                                  context='Editor',
github spyder-ide / spyder / spyder / widgets / sourcecode / codeeditor.py View on Github external
def create_shortcuts(self):
        codecomp = config_shortcut(self.do_completion, context='Editor',
                                   name='Code Completion', parent=self)
        duplicate_line = config_shortcut(self.duplicate_line, context='Editor',
                                         name='Duplicate line', parent=self)
        copyline = config_shortcut(self.copy_line, context='Editor',
                                   name='Copy line', parent=self)
        deleteline = config_shortcut(self.delete_line, context='Editor',
                                     name='Delete line', parent=self)
        movelineup = config_shortcut(self.move_line_up, context='Editor',
                                     name='Move line up', parent=self)
        movelinedown = config_shortcut(self.move_line_down, context='Editor',
                                       name='Move line down', parent=self)
        gotodef = config_shortcut(self.do_go_to_definition, context='Editor',
                                  name='Go to definition', parent=self)
        toggle_comment = config_shortcut(self.toggle_comment, context='Editor',
                                         name='Toggle comment', parent=self)
        blockcomment = config_shortcut(self.blockcomment, context='Editor',
                                       name='Blockcomment', parent=self)
        unblockcomment = config_shortcut(self.unblockcomment, context='Editor',
                                         name='Unblockcomment', parent=self)
        transform_uppercase = config_shortcut(self.transform_to_uppercase,
                                              context='Editor',
                                              name='Transform to uppercase',
                                              parent=self)
        transform_lowercase = config_shortcut(self.transform_to_lowercase,
                                              context='Editor',
                                              name='Transform to lowercase',
                                              parent=self)
github spyder-ide / spyder / spyder / widgets / sourcecode / codeeditor.py View on Github external
name='Kill previous word',
                                         parent=self)
        kill_next_word = config_shortcut(self.kill_next_word, context='Editor',
                                         name='Kill next word', parent=self)

        start_doc = config_shortcut(cb_maker('Start'), context='Editor',
                                    name='Start of Document', parent=self)

        end_doc = config_shortcut(cb_maker('End'), context='Editor',
                                  name='End of document', parent=self)

        undo = config_shortcut(self.undo, context='Editor',
                               name='undo', parent=self)
        redo = config_shortcut(self.redo, context='Editor',
                               name='redo', parent=self)
        cut = config_shortcut(self.cut, context='Editor',
                              name='cut', parent=self)
        copy = config_shortcut(self.copy, context='Editor',
                               name='copy', parent=self)
        paste = config_shortcut(self.paste, context='Editor',
                                name='paste', parent=self)
        delete = config_shortcut(self.delete, context='Editor',
                                 name='delete', parent=self)
        select_all = config_shortcut(self.selectAll, context='Editor',
                                     name='Select All', parent=self)
        array_inline = config_shortcut(lambda: self.enter_array_inline(),
                                       context='array_builder',
                                       name='enter array inline', parent=self)
        array_table = config_shortcut(lambda: self.enter_array_table(),
                                      context='array_builder',
                                      name='enter array table', parent=self)
github spyder-ide / spyder / spyder / widgets / sourcecode / codeeditor.py View on Github external
def create_shortcuts(self):
        codecomp = config_shortcut(self.do_completion, context='Editor',
                                   name='Code Completion', parent=self)
        duplicate_line = config_shortcut(self.duplicate_line, context='Editor',
                                         name='Duplicate line', parent=self)
        copyline = config_shortcut(self.copy_line, context='Editor',
                                   name='Copy line', parent=self)
        deleteline = config_shortcut(self.delete_line, context='Editor',
                                     name='Delete line', parent=self)
        movelineup = config_shortcut(self.move_line_up, context='Editor',
                                     name='Move line up', parent=self)
        movelinedown = config_shortcut(self.move_line_down, context='Editor',
                                       name='Move line down', parent=self)
        gotodef = config_shortcut(self.do_go_to_definition, context='Editor',
                                  name='Go to definition', parent=self)
        toggle_comment = config_shortcut(self.toggle_comment, context='Editor',
                                         name='Toggle comment', parent=self)
        blockcomment = config_shortcut(self.blockcomment, context='Editor',
                                       name='Blockcomment', parent=self)
        unblockcomment = config_shortcut(self.unblockcomment, context='Editor',
github spyder-ide / spyder / spyder / widgets / sourcecode / codeeditor.py View on Github external
name='Kill to line start',
                                          parent=self)
        yank = config_shortcut(self._kill_ring.yank, context='Editor',
                               name='Yank', parent=self)
        kill_ring_rotate = config_shortcut(self._kill_ring.rotate,
                                           context='Editor',
                                           name='Rotate kill ring',
                                           parent=self)

        kill_prev_word = config_shortcut(self.kill_prev_word, context='Editor',
                                         name='Kill previous word',
                                         parent=self)
        kill_next_word = config_shortcut(self.kill_next_word, context='Editor',
                                         name='Kill next word', parent=self)

        start_doc = config_shortcut(cb_maker('Start'), context='Editor',
                                    name='Start of Document', parent=self)

        end_doc = config_shortcut(cb_maker('End'), context='Editor',
                                  name='End of document', parent=self)

        undo = config_shortcut(self.undo, context='Editor',
                               name='undo', parent=self)
        redo = config_shortcut(self.redo, context='Editor',
                               name='redo', parent=self)
        cut = config_shortcut(self.cut, context='Editor',
                              name='cut', parent=self)
        copy = config_shortcut(self.copy, context='Editor',
                               name='copy', parent=self)
        paste = config_shortcut(self.paste, context='Editor',
                                name='paste', parent=self)
        delete = config_shortcut(self.delete, context='Editor',