我正在/ 正使用正要在上运行的regex和ipython插件进行导航ctrlr。我在“ regexsearchinstance.py”(在中~/.local/share/gedit/plugins/regex_replace
)中闻了一下,发现了这一点:
def create_menu_item(self):
"""
Create a menu item in the "Tools" menu.
"""
action = gtk.Action("RegexSearch",
_("Regular expression..."),
_("Search using regular expressions"), None)
action.connect("activate", self.on_open_regex_dialog)
action_group = gtk.ActionGroup("RegexSearchActions")
action_group.add_action_with_accel(action, "<control>r")
manager = self._window.get_ui_manager()
manager.insert_action_group(action_group, -1)
manager.add_ui_from_string(ui_str)
我将一行更改为:
action_group.add_action_with_accel(action, "<control><shift>f")
并退出gedit。现在正则表达式搜索加载ctrlshfitf。我在中看到类似的行/usr/lib/gedit/plugins/ipython.py
:
self._action_group.add_actions([('IPython', None,
_('Run in IPython'), '<Control>r', _('Clear the document'),
self.send_to_ipython)])
因此,如果您想实际编辑插件,以便它们默认使用不同的快捷方式,请在插件文件中<Control>
或<control>
或附近嗅探add_action
。