Running VIM inside Sage Shell
Is this possible? I want to work in Sage shell but I want to use VIM while typing up stuff in sage shell.
Is this possible? I want to work in Sage shell but I want to use VIM while typing up stuff in sage shell.
You can use any bash command by starting with !
, in you case:
sage: !vim my_file.txt
You can also run
sage: %edit
which will open whatever you have $EDITOR
set to first, and then fall back on vi
otherwise.
The file is then saved to a temporary file and run when you exit, unless you do %edit -x
(then it doesn't execute). While you're in your editor you can also write out to another file if you prefer.
See the documentation for the %edit
magic. It's a little confusing, but it does not work exactly the same as entering the code directly in the interactive prompt. If you just write a bare expression like 1 + 1
, although it will be evaluated, its results are not displayed. Instead you have to write something like print(1 + 1)
if you want the results displayed when executing the code. The %edit
command outputs the code entered as a string allowing you to do things like %edit _
to re-edit the previous code.
Asked: 2018-07-12 09:28:54 -0600
Seen: 217 times
Last updated: Jul 13 '18
5.12 command line startup looks odd
Sage subs() function include product condition
How can I add arrows at the end of sage plot axis?
Installing multiple versions of sage
practical documentation for sage; e.g. `%hide` and `%hideall`
Where is defined __gmpq_cmp_z?
Interactive solving differential equations with MAXIMA's desolve
Do you mean in the Sage shell, started by running
sage -sh
in the terminal, or in the Sage REPL (read-eval-print loop), started by runningsage
in the terminal?