program |
|for a bank. They wanted to |
|send out a special, |
|personalized letter. |
| |
|To their richest 1000 |
|customers. Unfortunately for |
|the programmer, |
+----------------------------------+
<
You end up with two lines:
>
+----------------------------------+
|A letter generation program for a |
|bank. They wanted to send out a s|
|pecial, personalized letter. |
|To their richest 1000 customers. |
|Unfortunately for the programmer, |
+----------------------------------+
<
Note that this doesn't work when the separating line is blank but not empty;
when it contains spaces and/or tabs. This command does work with blank lines:
>
:g/\S/,/^\s*$/join
This still requires a blank or empty line at the end of the file for the last
paragraph to be joined.
==============================================================================
*25.5* Editing tables
Suppose you are editing a table with four columns:
nice table test 1 test 2 test 3 ~
input A 0.534 ~
input B 0.913 ~
You need to enter numbers in the third column. You could move to the second
line, use "A", enter a lot of spaces and type the text.
For this kind of editing there is a special option: >
set virtualedit=all
Now you can move the cursor to positions where there isn't any text. This is
called "virtual space". Editing a table is a lot easier this way.
Move the cursor by searching for the header of the last column: >
/test 3
Now press "j" and you are right where you can enter the value for "input A".
Typing "0.693" results in:
nice table test 1 test 2 test 3 ~
input A 0.534 0.693 ~
input B 0.913 ~
Vim has automatically filled the gap in front of the new text for you. Now,
to enter the next field in this column use "Bj". "B" moves back to the start
of a white space separated word. Then "j" moves to the place where the next
field can be entered.
Note:
You can move the cursor anywhere in the display, also beyond the end
of a line. But Vim will not insert spaces there, until you insert a
character in that position.
COPYING A COLUMN
You want to add a column, which should be a copy of the third column and
placed before the "test 1" column. Do this in seven steps:
1. Move the cursor to the left