Ask Your Question

Running VIM inside Sage Shell

asked 2018-07-12 09:28:54 -0600

o6p gravatar image

Is this possible? I want to work in Sage shell but I want to use VIM while typing up stuff in sage shell.

edit retag flag offensive close merge delete


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 running sage in the terminal?

slelievre gravatar imageslelievre ( 2018-07-12 13:05:04 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2018-07-12 09:41:42 -0600

tmonteil gravatar image

You can use any bash command by starting with !, in you case:

sage: !vim my_file.txt
edit flag offensive delete link more

answered 2018-07-13 12:26:25 -0600

Iguananaut gravatar image

updated 2018-07-13 12:29:41 -0600

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-07-12 09:28:54 -0600

Seen: 116 times

Last updated: Jul 13 '18