0% found this document useful (0 votes)
51 views10 pages

VI Editor

vi is a text editor that has two main modes: command mode and input mode. Command mode allows the user to enter vi commands starting with symbols like "a", "i", "o" to perform actions like appending, inserting, or opening new lines of text. Input mode allows the user to directly enter or edit the content of the file. The document then provides summaries of common vi commands for cursor movement, deleting/cutting text, moving/copying text, searching, and changing text.

Uploaded by

raymart_omampo
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 PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views10 pages

VI Editor

vi is a text editor that has two main modes: command mode and input mode. Command mode allows the user to enter vi commands starting with symbols like "a", "i", "o" to perform actions like appending, inserting, or opening new lines of text. Input mode allows the user to directly enter or edit the content of the file. The document then provides summaries of common vi commands for cursor movement, deleting/cutting text, moving/copying text, searching, and changing text.

Uploaded by

raymart_omampo
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 PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

vi Editor

vi Modes
Command Mode
ESC puts you in command mode vi commands (a, i, o, etc.) ex commands, prefixed with a colon (:)

Input Mode

Cursor Control Summary


h or backspace move left one character j move down one line k move up one line l or space move right one character #w move forward word by word #b move backward word by word #e move to the end of the next word $ go to the end of the current line ^ or 0 go to the beginning of the current line

Cont.
G #G :# Ctrl g
Ctrl b Ctrl f Ctrl u Ctrl d L M H

Go to the end of the file Go to the line number # Go to the line number # Reports the line you have gone to
scroll back to the previous window of text scroll forward to next window of text scroll up half a window of text scroll down half a window of text Go to the last line on the screen Go to the middle line on the screen Go home

Return Go to the first non-blank character on next line

Input Modes
a i O o A I append new text after the cursor insert new text after the cursor Open a line for text above the current line Open a line for text below the current line append new text at the end of the line insert new text at beginning of the line

Deleting text
#x #dw #dd dG delete the character at the cursor delete the current word delete the current line delete through the last line of the file

d$
d^

delete to the end of the line


delete to the beginning of the line

To Undo u U undo the last modification undo all modifications to current line

Moving/Copying text
p(lowercase) P #yw #yy paste contents after the cursor paste contents before the cursor yank the current word yank the current line

yG
y$ y^

yank through the last line of the file


yank to the end of the line yank to the beginning of the line

Changing text
rcharacter replaces the character at the current cursor position

replaces all characters

Searching for text


/text ?text n N search for text from the current line towards the end of file search for text from the current line towards the beginning of file find the next occurrence of the previously searched text in the same direction find the next occurrence of the previously searched text in the reverse direction

Searching for text patterns


[oO]ld_text ^text text$ . character* .* Search for old_text and Old_text Search for text at the beginning of a line Search for text at the end of a line Search for any single character Search for zero or more occurrences of character Search for zero or more occurrences of any character

You might also like