Vim Recall繁體中文

Read shell output into the buffer

:read !printf "ready\n"

Example

Normal mode. Only line: header. Shell supports printf.

Before
header
  1. :read !printf "ready\n"<CR> Insert shell output below header · new line: ready
After
header
ready
Details & Vim help

Insert shell command output below the current line.

Bring generated text into a file without a clipboard round trip.

Vim runs the command through its configured shell. 'shellredir' determines whether error output is included. This example uses printf.

Try it in Vim

  1. Place the cursor on the line that should precede the output.
  2. Run :read !printf "ready\n"<CR>.
  3. Review the inserted line.