Reader small image

You're reading from  TextMate How-To

Product typeBook
Published inOct 2012
Reading LevelIntermediate
PublisherPackt
ISBN-139781849693981
Edition1st Edition
Languages
Right arrow
Author (1)
Christopher J Mears
Christopher J Mears
author image
Christopher J Mears

Chris Mears lives in San Francisco and is the lead web developer at Canned Banners, a startup he co-founded. Though he considers himself a generalist when it comes to technology, he finds true passion developing for the Web. When he's not thinking and dreaming about code, he enjoys going to concerts, practicing on his guitar, homebrewing beer, and tea snobbery. This is his first book.
Read more about Christopher J Mears

Right arrow

Moving and aligning text (Should know)


This task will show you how to move text around, whether you want to move a selection of text up, down, or align it.

How to do 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.

How it works...

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).

There's more...

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.

Moving text with the mouse/track pad

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.

Tip for moving entire lines of text

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.

Previous PageNext Page
You have been reading a chapter from
TextMate How-To
Published in: Oct 2012Publisher: PacktISBN-13: 9781849693981
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Christopher J Mears

Chris Mears lives in San Francisco and is the lead web developer at Canned Banners, a startup he co-founded. Though he considers himself a generalist when it comes to technology, he finds true passion developing for the Web. When he's not thinking and dreaming about code, he enjoys going to concerts, practicing on his guitar, homebrewing beer, and tea snobbery. This is his first book.
Read more about Christopher J Mears