How can I select every other line with multiple cursors in Sublime Text?

Solution 1:

  1. Find: Ctrl+F
  2. If regular expressions are not already enabled, enable them: Alt+R
  3. Type in the expression .*\n.*\n
  4. Find all: Alt+Enter
  5. Press left arrow to get rid of the selections, leaving just the cursors:
  6. You now have a cursor at the start of every odd-numbered line. If you wanted even-numbered lines, press down:
  7. Depending on the file, there might be one cursor missing right down the bottom of the file. Using the mouse (damn!) scroll to the bottom, hold down Ctrl, and click where the missing cursor should be to add it in.

Solution 2:

You can do it easily :

  • Select all your lines, or the whole document Ctrl+A
  • Add multiple selectors : Ctrl+Shift+L (and in Mac: Command + Shift + L)

EDIT :

  • Or use the great Joe Daley method with (.*(\n|$)){2} expression