##// END OF EJS Templates
Add config option for vi/emacs style open-editor shortcuts...
Thomas Kluyver -
Show More
@@ -191,6 +191,11 b' class TerminalInteractiveShell(InteractiveShell):'
191 191 help="Highlight matching brackets .",
192 192 ).tag(config=True)
193 193
194 extra_open_editor_shortcuts = Bool(False,
195 help="Enable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. "
196 "This is in addition to the F2 binding, which is always enabled."
197 ).tag(config=True)
198
194 199 @observe('term_title')
195 200 def init_term_title(self, change=None):
196 201 # Enable or disable the terminal title.
@@ -217,7 +222,9 b' class TerminalInteractiveShell(InteractiveShell):'
217 222 return
218 223
219 224 # Set up keyboard shortcuts
220 kbmanager = KeyBindingManager.for_prompt()
225 kbmanager = KeyBindingManager.for_prompt(
226 enable_open_in_editor=self.extra_open_editor_shortcuts,
227 )
221 228 register_ipython_shortcuts(kbmanager.registry, self)
222 229
223 230 # Pre-populate history from IPython's history database
@@ -77,10 +77,6 b' def register_ipython_shortcuts(registry, shell):'
77 77 filter=HasFocus(DEFAULT_BUFFER)
78 78 )(open_input_in_editor)
79 79
80 registry.add_binding('v',
81 filter=HasFocus(DEFAULT_BUFFER) & ViNavigationMode()
82 )(open_input_in_editor)
83
84 80 if shell.display_completions == 'readlinelike':
85 81 registry.add_binding(Keys.ControlI,
86 82 filter=(HasFocus(DEFAULT_BUFFER)
General Comments 0
You need to be logged in to leave comments. Login now