ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 08 Feb 2018 07:29:11 -0600Use Vi keys in sage consolehttps://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/ I wish to have the sage console use the vi-style editing keys instead of the default emacs ones. I have configured IPython to do this already, but sage does not respect this option. Any help would be appreciated.Sat, 17 Sep 2016 08:54:01 -0500https://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/Answer by Eigentime for <p>I wish to have the sage console use the vi-style editing keys instead of the default emacs ones. I have configured IPython to do this already, but sage does not respect this option. Any help would be appreciated.</p>
https://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/?answer=36052#post-id-36052Sage uses its own version of ipython with its own startup files. Those startup files should be under $DOT_SAGE/ipython-X.Y.Z/ ; so for me, the interesting directory is in ~/.sage/ipython-5.0.0/profile_default/ . There was no ipython_config.py file in there, so I copied it from the .ipython directory.
So here is what I did to get vi keybindings to work:
1. Get vi keybindings to work in ipython by adding the line <code>c.TerminalInteractiveShell.editing_mode = 'vi'</code> to .ipython/profile_default/ipython_config.py
2. `cp -n ~/.ipython/profile_default/ipython_config.py ~/.sage/ipython-5.0.0/profile_default/`Tue, 20 Dec 2016 00:58:48 -0600https://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/?answer=36052#post-id-36052Comment by LAV for <p>Sage uses its own version of ipython with its own startup files. Those startup files should be under $DOT_SAGE/ipython-X.Y.Z/ ; so for me, the interesting directory is in ~/.sage/ipython-5.0.0/profile_default/ . There was no ipython_config.py file in there, so I copied it from the .ipython directory.</p>
<p>So here is what I did to get vi keybindings to work:</p>
<ol>
<li>Get vi keybindings to work in ipython by adding the line <code>c.TerminalInteractiveShell.editing_mode = 'vi'</code> to .ipython/profile_default/ipython_config.py</li>
<li><code>cp -n ~/.ipython/profile_default/ipython_config.py ~/.sage/ipython-5.0.0/profile_default/</code></li>
</ol>
https://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/?comment=41032#post-id-41032If you don't have the ipython_config.py file, you can create it with
`> ipython profile create [profilename]`
in the terminal. It will also populate the file with all possible options including vi mode. (And thank you @Eigentime, it solved it for me)Thu, 08 Feb 2018 07:29:11 -0600https://ask.sagemath.org/question/34847/use-vi-keys-in-sage-console/?comment=41032#post-id-41032