|
|
To read a file into vi at the current cursor position, switch to command mode and press :r, then type the name of the file. If the file is readable, its contents will be inserted below the cursor.
You can use addresses with this command, including 0 to specify a dummy line before the first line in the file. For example, if you want to add the file preamble at the top of soliloquy, used in a previous example, you would enter :0r preamble to produce:
Hamlet's soliloquy from Act III Scene 1:The command :r loads another copy of the last-saved version of the present file below the current line.To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, . . .