Escaping to a shell command
Last revision August 2, 2004
Table of Contents: |
You can run another command, such as ls, without leaving the editor. Just type
:! command_and_its_arguments <CR>
The single command (or pipeline) will be run, with output displayed on the screen as appropriate. You will then be requested to press the <CR> key again to re-draw the vi screen.
An alternative form allows you to run another command, capture its output, and insert that output into your file on new lines starting after the line the cursor is on. This usage is described in the section on moving text from one file to another.