eval.vim: eval sel or file in external interpreter.

This is a generic solution to evaluate the current word, line, selection,
region, file, etc. in an external interpreter. filetypes must define b:filecmd
and optionally b:clipcmd and b:clipmax (which defaults to 5). For example, in
the case of ipython:

let b:filecmd = "%run {FILE}"
let b:clipcmd = "type --window {WIN} " . shellescape("%paste\n", 1)

Notice than filecmd is typed verbatim into the target window while clipcmd is
passed to xdotool with WIN substituted by the target window id. So clipcmd can
send key, type and mouse events to this window.

The heuristic to determine how to send text T to the target window is:

1. If T has only one non-blank line or it's just a word, send it directly with
   blank lines trimmed.

2. If once opening and closing blank lines of T were trimmed less or equal than
   clipmax lines remain, and if clipcmd is defined, send this remaining lines
   using clipcmd.

3. Otherwise, send T as a file using filecmd. If T equals the current buffer
   contents and the current buffer is attached to a file, then use this file.
   Otherwise, create a temporary file and copy T to it.
ipython: use tk matplotlib backend.

python3, pygobject, matplotlib, ipython: currently this is a mess:

1) There is no pygtk for python3, the modern replacement is pygobject.

2) ipython 1.1 (stable) doesn't support --pylab==gtk3 (pygobject). ipython 2
   (dev) does support it but defaults to the matplotlib Gtk3Agg backend, not the
   Gtk3Cairo backend.
   https://github.com/ipython/ipython/pull/4640

3) matplotlib Gtk3Agg backend is broken in python3.
   https://github.com/matplotlib/matplotlib/pull/1227.

So these are some possible solutions:

a) Install ipython-git and set the Gtk3Cairo backend in matplotlibrc. Then set
   pylab=auto instead of pylab=gtk3, so that Gtk3Cairo is chosen instead of
   Gtk3Agg. This is overkilling: unstable package, config tweaks.

b) Just use another, non-gtk, backend: tk and qt work fine.