cursor.
See |++opt| for the possible values of [++opt].
:{range}r[ead] [++opt] [name]
Insert the file [name] (default: current file) below
the specified line.
See |++opt| for the possible values of [++opt].
*:r!* *:read!*
:[range]r[ead] [++opt] !{cmd}
Execute {cmd} and insert its standard output below
the cursor or the specified line. A temporary file is
used to store the output of the command which is then
read into the buffer. 'shellredir' is used to save
the output of the command, which can be set to include
stderr or not. {cmd} is executed like with ":!{cmd}",
any '!' is replaced with the previous command |:!|.
See |++opt| for the possible values of [++opt].
These commands insert the contents of a file, or the output of a command,
into the buffer. They can be undone. They cannot be repeated with the "."
command. They work on a line basis, insertion starts below the line in which
the cursor is, or below the specified line. To insert text above the first
line use the command ":0r {name}".
After the ":read" command, the cursor is left on the first non-blank in the
first new line. If in Ex mode, then the cursor is left on the last new
line (sorry, this is Vi compatible).
If a file name is given with ":r", it becomes the alternate file. This can be
used, for example, when you want to edit that file instead: ":e! #". This can
be switched off by removing the 'a' flag from the 'cpoptions' option.
Of the [++opt] arguments one is specifically for ":read", the ++edit argument.
This is useful when the ":read" command is actually used to read a file into
the buffer as if editing that file. Use this command in an empty buffer: >
:read ++edit filename
The effect is that the 'fileformat', 'fileencoding', 'bomb', etc. options are
set to what has been detected for "filename". Note that a single empty line
remains, you may want to delete it.
*file-read*
The 'fileformat' option sets the <EOL> style for a file:
'fileformat' characters name ~
"dos" <CR><NL> or <NL> DOS format
"unix" <NL>