Editing in vi

  • Open the file that needs to be edited. From the terminal run:
  • vi /some-directory/some-file

Use the arrow keys to navigate to the line that needs to be edited then type one of the following to start editing:

  • i - to insert text before the cursor
  • a - to insert text after the cursor

Edit the text as necessary and then press Esc to exit editing.

  • d - deletes an entire line.
  • :x - to save the file and exit
  • :w - to save the file
  • :q - to quit (exits back to terminal session) vi

Go back to the How-to Guides main page.

Web accessibility:

A A A A

For more information about these functions and how to use them, view the web accessibility page.


Valid XHTML 1.0 Strict

Valid CSS!