MCPcopy Create free account
hub / github.com/ipython/ipython / vi_mode

Method vi_mode

IPython/terminal/prompts.py:17–26  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 self.shell = shell
16
17 def vi_mode(self):
18 if (getattr(self.shell.pt_app, 'editing_mode', None) == EditingMode.VI
19 and self.shell.prompt_includes_vi_mode):
20 mode = str(self.shell.pt_app.app.vi_state.input_mode)
21 if mode.startswith('InputMode.'):
22 mode = mode[10:13].lower()
23 elif mode.startswith('vi-'):
24 mode = mode[3:6]
25 return '['+mode+'] '
26 return ''
27
28
29 def in_prompt_tokens(self):

Callers 1

in_prompt_tokensMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected