0% found this document useful (0 votes)
82 views1 page

Vi Summary

The document provides a summary of common commands for the vi text editor. It lists commands for opening and saving files, entering and appending text, deleting text and lines, searching, undoing, and displaying line numbers. The vi editor operates in either insert mode for adding text or command mode for other actions. Users are advised to consult the UNIX manual for additional vi commands.

Uploaded by

jaishan_20022810
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views1 page

Vi Summary

The document provides a summary of common commands for the vi text editor. It lists commands for opening and saving files, entering and appending text, deleting text and lines, searching, undoing, and displaying line numbers. The vi editor operates in either insert mode for adding text or command mode for other actions. Users are advised to consult the UNIX manual for additional vi commands.

Uploaded by

jaishan_20022810
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Vi Editor Command Summary

Common vi Editor commands

This vi editor command summary is provided to help students get a quick start in the use of this editor in
the Harris Computer Lab. Bold letters indicate the command and italics indicate a sample file name or a real
file which you would enter in your command line. It is recommended that you obtain a current UNIX manual
to use in conjunction with this guide. Use the UNIX command “man vi” to learn additional vi commands.

The vi editing session operates in two modes, <Esc>+<i> for insert mode for entering text, and
<Esc>+<other command> for operating in command mode. + indicates keystrokes to be entered in sequence.
_ indicates a space.

vi Editor command Syntax Description


Open a file vi file1 Open program in command mode
Save a file <Esc>+<:>+w+! Saves a file with current file name
Save with new name <Esc>+<:>+w+_+file1 Saves a file with new name specified
Quit editing, no save <Esc>+<:>+q+! Quit edit session without saving
Insert text <Esc>+i+<input Enter text before cursor until finished, then <Esc>
text>+<Esc>

Append text <Esc>+a+<input Enter text after cursor until finished, then <Esc>
text>+<Esc>
Delete text <Esc>+x Position cursor, strike x for each character
you wish to remove
Delete line <Esc>+dd Position cursor, strike key for each line you wish to remove
Search for pattern <Esc>+/+<input pattern> Position cursor, strike <Esc>+/+”findthis”
Delete word <Esc> + dw Delete word (into buffer)

Undo <Esc> + u Undo last command

Join two lines <Esc> + J Join next line to end of current line
Line number <Esc> + <:> + nu Display current line number

(Revised 02/26/04) vi-editor.doc

You might also like