A Multiple Cursors Use Case

Our maximal leader, John Wiegley, has posted a very nice video in which he demonstrates one of the ways that he uses Magnar Sveen’s excellent multiple cursors package. There’s more to multiple cursors than just popping up a bunch of cursors and then editing the text under them.

The TL;DR is that Wiegley wants to renumber some of the comments of the form STEP 5 but not all of them. Some of the numbers are already correct and others are references to one of the other steps. To do this he uses mc/mark-next-like-this to put a cursor on the next STEP N and mc/skip-to-next-like-this to skip the ones he doesn’t want to change. Finally, he deletes each of the numbers and uses mc/insert-numbers to renumber the STEP at each of the cursors. It’s a very nice and simple workflow. It’s nice how multiple cursors has all of the tools needed to make this so easy.

The video is only 2 minutes 53 seconds long so there’s no reason not to watch it immediately. It’s a great example of a simple but effective workflow.

This entry was posted in General and tagged . Bookmark the permalink.