user1953384
user1953384

Reputation: 1059

IPython split screen

Is there some way to vertically split the screen in IPython so that I can see my code and the interpreter simultaneously? I'm using Vim for editing. Right now, I use two terminal tabs - one for Vim and the other for IPython.

Thanks!

Upvotes: 2

Views: 3069

Answers (3)

Paul Ivanov
Paul Ivanov

Reputation: 2024

If you're using IPython with ZeroMQ enabled, take a look at vim-ipython (I'm the author, but it ships with IPython)

Using this plugin, you can send lines or whole files for IPython to execute, and also get back object introspection and word completions in Vim, like what you get with: object?<enter> and object.<tab> in IPython. If you use gVim, you'll also get object docstring tooltips when you hover over the text (see the screencast mentioned below).

Take a look at two screencasts of this plugin in action on this post. Don't worry about the connection string looking different, that's just the way it was back in IPython 0.11.

Upvotes: 3

Fran&#231;ois
Fran&#231;ois

Reputation: 8138

You can do this with tmux (http://tmux.sourceforge.net/)

With tmux's default configuration, run tmux, then you can vertical split using ctrl-b %. You can move between left and right side with ctrl-b <arrow>.

You can also do much more with it, such as horizontal split (ctrl-b "), start a terminal in a tab (ctrl-b c), attach your existing tmux session from another computer ($ tmux attach)...

It can be tweaked to use gnu screen's keyboard shortcuts (with prefix ctrl-a). You can also enable mouse support to switch panes, resize them, swich tab (see http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/).

Upvotes: 3

qzr
qzr

Reputation: 732

You could use the plugin ConqueShell (http://www.vim.org/scripts/script.php?script_id=2771)

Start an ipython interpreter in split mode:

vertical split:

:ConqueTermVSplit ipython

however, I found a horizontal split easier to use:

:ConqueTermSplit ipython

You can switch windows as you normally would in VIM by C-w-j C-w-k etc. Text selections can be sent to the ConqueShell window by pressing F9 (default key binding, of course you can change this).

As an example of how it looks (ipython to the right in v-split, a bash shell in the bottom left): https://i.sstatic.net/QFxss.png (I can't include images directly due to lack of reputation)

Upvotes: 2

Related Questions