2

When using vim (or any other text editor) for python scripts, is there a way to run a section of your script alone?

Matlab has a feature where beginning a line with %% splits the lines of code that follow into a section of its own, that can be run independently. Is there a way of achieving this without having to use iPython? Even if the solution is a bit hacky, it would be an improvement over what I currently am doing, which is commenting out blocks that I don't want to run.

2

1 Answer 1

1

A generic solution would be vim-slime: https://github.com/jpalardy/vim-slime

SLIME is an Emacs plugin to turn Emacs into a Lisp IDE. You can type text in a file, send it to a live REPL, and avoid having to reload all your code every time you make a change.

Vim-slime is a humble attempt at getting some of these features into Vim. It works with any REPL and isn't tied to Lisp.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.