This task will show you how to move text around, whether you want to move a selection of text up, down, or align it.
The different options used to move and align text are as follows:
Moving a selection up a line will insert the selected text into the previous line. From the menu, select Text | Move Selection | Line Up (Command + Control + up arrow).
Moving a selection down a line will insert the selected text into the next line. From the menu, select Text | Move Selection | Line Down (Command + Control + down arrow).
Left aligning will align text to the left. From the menu, select Text | Align | Left.
Right aligning will align text to the right margin based on the Wrap Column setting. From the menu, select Text | Align | Right.
Center aligning will center text using the Wrap Column setting as a guide. From the menu, select Text | Align | Center.
Justifying will space out the text evenly using the Wrap Column setting as a guide. From the menu, select Text | Align | Justify.
Moving selections: When you are moving a selection of text, it is just as if you are dragging the text around with your mouse cursor (see Moving text with the mouse/track pad in the There's more… section). Don't be afraid. As you'll see in the following screenshot, it will not overwrite the line you are moving your selection to:
Aligning text: An important thing to note is that the alignment is based on the Wrap Column size (select View | Wrap Column).
Since TextMate is a full-featured GUI text editor, you may also move text with the mouse or track pad. Plus, we'll look at a tip for moving entire lines up or down.
You can also move the text around by clicking and dragging a selection with your mouse or track pad, just like most other word processors. However, keeping your hands on the keyboard is faster and reduces repetitive strain (that is, carpal tunnel syndrome), and is typically preferred by hardcore coders.
You can also move the entire line with the cursor, not by making a selection, but rather by invoking Line Up (Command + Control + up arrow) or Line Down (Command + Control + down arrow). However, notice that your cursor will stay positioned on the previous line. Therefore, you may prefer to select the line (Command + Shift + L) and then move it around as you please.