Examples of inserting the contents of another file

To insert a file immediately after the line containing the cursor:

   :r examples.txt

This inserts the contents of the file examples.txt immediately after the current line.


To insert the contents of another file after a specific line in the current file:

   23:r toc.txt

This inserts the contents of the file toc.txt after line 23 of the current file. Line 24 is empty; the contents of the inserted file begin at line 25.


[Home] [Search] [Index] This site maintained by unixhelp@hardrock.org