Sunday, May 16, 2010

Selecting a Text Block

I just came across the shortcut of the year for MS Word over at TechRepublic.  Normally, when selecting text, you select it in a continuous line.  You can expand the selection forwards or backwards.

But, did you know that you can select a text block?  This is one of the powerful features of Vim for those of you who have used Unix computers.

Just hold the ALT key while you click.

For example, if I have the following text:

REM First  line
REM Second line
REM Third  line

You can hold the ALT key and then select the first three letters of each sentence:


REM First  line
REM Second line
REM Third  line

You can also cut and paste a block of text. In the above example, one could cut the selection and then paste it in the middle of the first line, resulting in:


 First REM line
 SecondREM line
 Third REM line

Note that selection of text blocks does not work inside of tables.

[Source TechRepublic]

No comments:

Post a Comment