:r !date
will read in the system's date information into the text of your file.
By preceding the :r command with a line address, you can read
the result of the command in at any desired point in your file. By
default, it will appear after the current line.
Suppose you are editing a file and want to read in four phone
numbers from a file called phone, but in alphabetical
order.
phone reads:
Willing, Sue 333-4444
Walsh, Linda 555-6666
Quercia, Valerie 777-8888
Dougherty, Nancy 999-0000
:r !sort phone
reads in the contents of phone after they have been passed
through the sort filter:
Dougherty, Nancy 999-0000
Quercia, Valerie 777-8888
Walsh, Linda 555-6666
Willing, Sue 333-4444
Suppose you are editing a file and want to insert text from
another file in the directory, but you can't remember the new file's name.
You could perform this task the long way: exit your
file, give the ls command, note the correct filename,
reenter your file, and search for your place.
Or you could do the task in fewer steps: