Sublime Text 2 multiple line edit

Syperus picture Syperus · Feb 28, 2014 · Viewed 212.3k times · Source

I want to edit multiple lines and every "word" within that line. For example:

45 28 42 65
24 87 47 95
01 25 87 98

I want to select every whole number in all lines and put a "0x" before it so it would look like:

0x45 0x28 0x42 0x65
0x24 0x87 0x47 0x95
0x01 0x25 0x87 0x98

I know the Ctrl+shift+L to get cursors on each line, but how can I get the cursors in front of every number to mass edit all at once?

Answer

Owen picture Owen · Feb 28, 2014

Highlight the lines and use:

  • Windows: Ctrl+Shift+L
  • Mac: Cmd ⌘+Shift+L

You can then move the cursor to your heart's content and edit all lines at once.

It's also called "Split into Lines" in the "Selection" menu.