Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two-way vim-ipython integration #631

Merged
merged 1 commit into from Jul 30, 2011
Merged

Conversation

ivanov
Copy link
Member

@ivanov ivanov commented Jul 29, 2011

here's a new and improved way of getting vim and ipython to talk to each other. Thanks to @minrk for guiding me through the protocol.

I also made a little demo of these new capabilities which you might be interested in checking out here: http://www.pirsquared.org/vim-ipython/

Others want to join in the fun in improving ipy.vim can do so here: http://github.com/ivanov/vim-ipython

stderr = IOStream(sys.stderr)
stdin = IOStream(sys.stdin,os.tmpfile())
stdout = IOStream(sys.stdout,os.tmpfile())
stderr = IOStream(sys.stderr,os.tmpfile())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these lines were just a way for me to get vim to import IPython, but it was a kludge done without much thought. There's likely something else that should be done here, so please let me know what that should be

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to do this with all of them, or a subset? I realize that sys.stdin can sometimes be None, for example.

An alternative is to assign appropriate streams to sys.stdin/out/err prior to importing IPython things, but we should probably handle this gracefully.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to python docs, sys.stderr and sys.stdout are only required to have write() methods, but I've monkeypatched vim's stdout and stderr to fix this. Vim actually added flush() in their trunk

@fperez
Copy link
Member

fperez commented Jul 29, 2011

@ivanov, this is a bit too dangerous to merge this close to release, but it's very cool! I just saw the demo video, and it's awesome. We'll cut 0.11 without this, and can then merge it with plenty of time to deal with any possible problems before 0.12.

Thanks!

@ivanov
Copy link
Member Author

ivanov commented Jul 29, 2011

now with no changes to IPython trunk! 0.11? :)

fperez added a commit that referenced this pull request Jul 30, 2011
Two-way vim-ipython integration.
@fperez fperez merged commit bd572cd into ipython:master Jul 30, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Two-way vim-ipython integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants