Skip to navigationSkip to content
PASTE SPECIAL

How to use coding apps like a pro to work magic with text

By Keith Collins

If you’ve ever looked over a programmer’s shoulder and seen a screen filled with code, you were looking at a text editor.

Programmers use free apps like Sublime Text, Notepad++ and GitHub’s Atom because they’re really good at handling plain text. Their minimal interfaces may suggest minimal functionality, but you can do much more with these programs than you can with Microsoft’s Notepad or Apple’s TextEdit. And you don’t have to be a programmer to use them.

Suppose you’re throwing a party for famous programmers and your guest list is in bad shape. Text editors are great at managing lists, because they’re built to edit multiple lines at once. That’s useful for code, but it can be useful for plain text as well–and it can be a lot faster than loading up Excel and trying to remember a bunch of formulas.

Multi-select, multi-copy, multi-paste

Let’s say your guest list is so messed up that the first name and last names got separated. Maybe someone copied them out of a spreadsheet, and now you have to stitch them back together. Here’s what to do:

  1. Select all of the last names by holding down the command key (control key in Windows) and double-clicking or click-and-dragging on each of them.
  2. Once they’re all selected, you can press command-x to cut, just like you normally would.
  3. Then you can select all of the first names, and press command-shift-L to select them as individual lines.
  4. Once they’re selected, press the right arrow key to go to the end of each line, press space, and press command-v to paste last names in.

Rearrange with ease

Now you have the names together,  but they’re formatted to have the first name first, and you want it the other way around. No problem:

  1. You can select all of the last names by holding down the command key (control key in Windows) and double-clicking or click-and-dragging on each of them.
  2. Once they’re all selected, you can press command-x to cut, just like you normally would.
  3. Then you can select all of the first names, and press command-shift-L to select them as individual lines.
  4. Once they’re selected, just press the left arrow key to go to the front of the line, and press command-v to paste the first names back in.
  5. You should see cursors on each line now, and they should all be blinking at the end of the first names. Anything you type now will show up on each of those lines. So if you type a comma and a space, you’re all set.

Prepend text to a list

Maybe you want to formalize things a bit and add a title to the beginning of each name. With a text editor, you can add them all at once:

  1. Hold the command key (control key in Windows) and click at the beginning of each line you want to prepend text to.
  2. Once all of the lines are selected, you can start typing.

Remove text from multiple lines at once

Eh, maybe the titles are too formal. So let’s remove them:

  1. Select the entire list.
  2. Press command-shift-L to select each item individually. (Control-shift-L in Windows.)
  3. Press the left arrow key to go to the beginning of the line.
  4. Hold the shift key, and press the right arrow until you get to the beginning of the first names. Then press delete.

Obviously, this works best when you’re lucky enough to have a list where the items you want to delete all have the same number of characters.

Append text to a list

The same way we can prepend text to the beginning of a list, we can also append text to the end:

  1. Select the entire list.
  2. Press command-shift-L to select each item individually. (Control-shift-L in Windows.)
  3. Press the right arrow key to go to the end of the line.
  4. Start typing.

Bonus: Now that you have your guest list nicely formatted, why not put it in some kind of order. The programmers in question–both living and dead–would probably like that. In most text editors, you can sort a list alphabetically by selecting the text and pressing F5. All that’s left to do now, if you want all of the guests on your list to come to your party, is to invent a time machine.