Add a user defined vi editor command:
This will make it so that when the user types :Legend in normal mode, a block of text is added under the cursor.
Step 1: Put this line into a file named /home/el/legend_header.txt:
this text will be added
Step 2: Put this command into your /home/el/.vimrc file (if the file doesn't exist, create it):
"The following command puts the contents of /home/el/legend_header.txt
"under the cursor when the user types ":Legend" in normal mode.
command Legend :r /home/el/legend_header.txt
Step 3: Restart vi for the changes to take effect. You're done.
Test it
Step 1: Open a new file in vi. Be in the default "normal mode" in vi. Type :Legend
Step 2: The contents of /home/el/legend_header.txt should be added where the cursor is.