sponsor Vim development Vim logo Vim Book Ad

vimteractive : Sending commands from vim to interactive programs

 script karma  Rating 0/0, Downloaded by 121  Comments, bugs, improvements  Vim wiki

created by
Will Handley
script type
*vimteractive.txt*   Sending commands from vim to interactive programs

                    Vimteractive - main help file

CONTENTS                                                  *vimterative-contents*

    3.Extending functionality......................|vimteractive-extending|

1. Intro                                                  *vimteractive-intro*

Vimteractive was inspired by the workflow of the vim-ipython plugin:


This plugin is designed to extend a subset of the functionality of vimteractive
to other interpreters (including ipython).

The activating commands are
- ipython |:Iipython|
- python  |:Ipython|
- maple   |:Imaple|
- bash    |:Ibash|

Commands may be sent from a text file to the chosen terminal using CTRL-S.
See |v_CTRL_S| for more details.

2. Usage                                                  *vimteractive-usage*

Example usage:

Create a python file vimteractive_test.py with the following content:

    import matplotlib.pyplot as plt
    import numpy

    fig, ax = plt.subplots()
    x = numpy.linspace(-2,2,1000)
    y = x**3-x
    ax.plot(x, y)

Now start an ipython interpreter in vim with :Iipython. You should see a
preview window open above with your ipython prompt. Position your cursor over
the first line of vimteractive_test.py, and press  CTRL-S. You should see this
line now appear in the first prompt of the preview window. Do the same with
the second and fourth lines. At the fourth line, you should see a figure
appear once it's constructed with plt.subplots(). Continue by sending lines to
the interpreter. You can send multiple lines by doing a visual selection and
pressing CTRL-S.

If you switch windows with CTRL-W k, you will see the terminal buffer switch
to a more usual looking normal-mode buffer, from which you can perform
traditional normal mode commands. However, if you try to insert, you will
enter the terminal, and be able to enter commands interactively into the
prompt as if you had run it in the command line. You can save this buffer if
you wish to a new file if it contains valuable output

Supported terminals                                   *vimteractive-terminals*
*:Iipython* Activate an ipython terminal
*:Ipython*  Activate a python terminal
*:Imaple*   Activate a maple terminal
*:Ibash*    Activate a bash terminal

Sending commands                                                    *v_CTRL_S*

CTRL-S sends lines of text to the interpreter in a mode-dependent manner:

In |Normal-mode|, CTRL-S sends the line currently occupied by the cursor
the terminal.

In |Insert-mode|, CTRL-S sends the line currently being edited, and then
returns to insert mode at the same location.

In |Visual-mode|, CTRL-S sends all currently selected lines to the terminal.

3. Extending functionality                            *vimteractive-extending*

This project is very much in an alpha phase, so if you have any issues that
arise on your system, feel free to contact me:


In many cases, you simply need to add an extra I<interpreter name> command to

4. About                                          *vimteractive-functionality*

The core maintainer of vimteractive is:

    Will Handley (GitHub: williamjameshandley)

Find the latest version of vimteractive at:


5. License                                              *vimteractive-license*

Vimteractive is licensed under GPL 3.0
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vimteractive.tar.gz 1.1 2018-10-13 8.0 Will Handley Better pasting into ipython
vimteractive.tar.gz 1.0 2018-06-21 7.0 Will Handley Switch from pexpect to native vim terminal
vimteractive.tar.gz 0.2 2018-05-27 8.0 Will Handley Further robustness improvements
vimteractive.tar.gz 0.1 2018-05-27 8.0 Will Handley Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
OSDN.net Logo