First go to conque (Thanks to Nico Raffo for the plug-in and helping me to include IPython functionality in it) page and install the plug-in following the simple installation instructions. (In my Fedora 12 system, I pulled the latest tar.gz package from the download list section and extracted it under ~/.vim folder.) Next grab the latest conque_term_pylab.vim file from the same section and place under ~/.vim/plugin directory.
When you open a simple Python script you can easily launch an "IPython -pylab" instance by hitting F6 and execute the whole script content by F8, use F9 to send a visual selection. The IPython inside the buffer acts as a part of GVIM, so you can easily switch between buffers and copy/move text from/to buffers. You can modify the IPython switch, default window position, mapped keys editing conque_term_pylab.vim
The screenshot below shows the bridge in action:
Hint: Add the following line into your vimrc file to get equally spaced buffer windows independent of the main GVIM window size.
autocmd VimResized * wincmd =
Currently only %run magic of IPython is implemented. Here are some of the ideas that could be added to improve this IPython + VIM integration:
- Add %whos key-mapping
- Launch IPython -pylab on start-up automatically if a Python script is opened.
- If "run" command is sent before an IPy launched instantiate one automatically.
- Make sure only one instance of IPython is running!
- GUI integration, create GVIM menus, reading %whos values back into a separate window and changing values.
Uses the "termios" module, so *nix only. No MS Win suppport, sadly. Thanks, though!
ReplyDeleteThis is pretty awesome. I do have one suggestion though; you should make the -pylab arg to ipython depend on a g: var (since not everyone requires it; you could just also generalize this and have a var for args to pass to ipy on startup). Thanks again for sharing this.
ReplyDeleteanybody know if anything like this ( IPython plus gvim) for us MS Windows slobs?
ReplyDeleteI'm begging here.
Sorry, no Windows support for the time being. Please fill a port request at http://code.google.com/p/conque/issues/list You might convince Nico to write a port for Win.
ReplyDelete@2nd Anonymous,
Could you please send your generic version? I use pylab almost all the time, but it might be a good idea to have something more generic than my use.
Hi, this is Nico, the developer of the ConqueTerm project. I am holding off on a Windows version until GVim.exe is compiled against Python 2.5+ by default, so I can use the ctypes modules. I'm hoping this will happen with Vim 7.3.
ReplyDeleteIn the meantime you could try this plugin:
http://www.vim.org/scripts/script.php?script_id=1974
I personally couldn't make it work the first time I tried it, but the demo looks terrific.