Ask Your Question
0

Running VIM inside Sage Shell

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

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

Comments

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 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

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

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
1

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

Iguananaut gravatar image

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

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

Stats

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

Seen: 48 times

Last updated: 2 days ago