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

Manipulating multiple lines and columns of text (Should know)


This is a more advanced task that will show how to select and edit multiple lines and columns of text.

Getting ready

Since this task is most useful with a list or multiple columns of text, you'll want to start out with something like the following:

How to do it...

The steps to manipulate multiple lines and multiple columns of text are as follows:

  1. Make a selection, ending the selection after the final character of the last row, as shown in the following screenshot:

  2. Switch to Column Selection by pressing the Option key, or from the menu, select Edit | Change to Column Selection:

  3. Edit the selection by holding down the Shift key and moving with the arrow keys. In this case, hold Shift and tap the right arrow key once to complete the full column selection:

  4. While the column is selected, you can move it by selecting Text | Move Selection | Column Left (Command + Control + left arrow) or by selecting Text | Move Selection | Column Right (Command + Control + right arrow).

  5. To edit all of the lines in a selection, make your selection, and from the menu, select Text | Edit Each Line in Selection (Command + Option + A). Once this is done, start typing and each line will be changed:

How it works...

Though the column manipulation is mainly used for data organization, the Edit all lines in a selection option has some very practical use cases for editing code. For example, if you have a list of items in HTML but don't want to copy and paste list item tags (that is, <li>) for each line, you can use the following set of keystrokes to quickly surround all of the items in <li> tags.

Select all of the lines, press Command + Option + A, and start typing the opening tag (<li>), followed by Command + right arrow (to move to the end of the line), and type the closing tag (</li>):

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