[IPython-dev] Multiple selections

William Stein wstein at gmail.com
Wed Oct 22 14:08:20 EDT 2014


On Wed, Oct 22, 2014 at 10:55 AM, Matthieu Gomez
<gomez.matthieu at gmail.com> wrote:
> Hello,
>
> I'm a recent (R) user of IPython and I find it amazing.
>
> I'm using the current Github version. I've discovered that I could select
> multiple lines of codes and edit them (by using ALT), which is awesome. In a
> similar spirit, is it possible to select multiple words starting from a
> selection of one?. In Sublime Text, if one selects some characters and press
> CMD + D, then both the current selection and the next set of character
> matching the current selection are selected. Pressing CMD+D a second time
> adds the third set of characters to the selection, etc (here is a video
> https://www.youtube.com/watch?v=i2SVJa2EGIw). This is very helpful when one
> wants to modify the name of a variable everywhere in the code.
>
> However, as of now, when I press CMD + D, the selection is deleted. I was
> wondering whether this feature was implemented, maybe under a different
> shortcut.

I'm guessing that IPython just got this functionality as a side-effect
of upgrading to Codemirror 4.
Codemirror has a Sublime keybinding mode, which provides precisely the
functionality you mention
above.  So if IPython could expose setting the sublime (and vim and
emacs?!) keybinding modes
that Codemirror supports, then you get the above functionality.

In SageMathCloud (https://cloud.sagemath.com), you can set sublime
keybindings in account settings, then open a file (anything except
ipython notebooks, which don't inherit these settings *yet*), and edit
it, and it works as you expect above.  I've actually been wondering
about how to do this, since I love multiple cursors, and I'm pleased
that it just works.

William

>
> Thanks a lot!
>
> Matthieu
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org



More information about the IPython-dev mailing list