ivanov/vim-ipython — pull request #24 by dstahlke (2012-01-31 00:23:48+00:00)
Title: execute visual/motion; syntax of doc window

Paul,

I have made three changes:

1) The doc window gets "set syntax=rest" so that it can be colorized properly if the user has installed the rest syntax plugin (which isn't part of stock vim).

2) Ability to execute a block of python code selected visually, or via a motion command. I have mapped "<leader>p" for this purpose, although feel free to change that of course. "<leader>p" with code visually selected of course executes that visual selection. In normal mode, "<leader>p" acts as an operator which takes a motion. So for instance "\piw" executes the current word, "\pi)" executes stuff within parenthesis, "\pp" executes the current line, etc. This is useful for inspecting the value of a variable or half of an expression.

3) I have made some of the key mappings route through "<Plug>" mappings. So for instance, there is a mapping "<Plug>IPyRunLine" for running the current line. The advantage of doing it this way is that users are able to easily set up the key mappings however they want. See ":help using-<Plug>" for more info on this.

- Dan