vi
vi
command mode
Esc
insert mode
ioaIOA
ex mode
:
vi help
Exiting vi
Command |
Action |
|---|---|
|
write out |
|
write out and quit |
|
write out and quit |
|
quit (if write out is over) |
|
ignore changes and quit |
Moving around in vi
Command |
Action |
|---|---|
|
left |
|
down |
|
up |
|
right |
vi command mode
Screen Manipulation
Command |
Action |
|---|---|
|
Scroll forward one screen |
|
Scroll backward one screen |
|
Scroll down half screen |
|
Scroll up half screen |
|
Redraw screen |
|
Redraw screen removing deleted stuff |
Moving Around
Command |
Action |
|---|---|
|
start of the current line |
|
end of the current line |
|
beginning of next word |
|
beginning of preceding word |
|
first line in the file |
|
first line in the file |
|
nth line in the file |
|
nth line in the file |
|
last line in the file |
|
last line in the file |
Changing Text
Command |
Action |
|---|---|
|
replace single char under cursor |
|
replace chars from cursor till Esc |
|
change word under cursor, from current char till Esc |
|
change N words, from current char till Esc |
|
change chars in current line till Esc |
|
change current line till Esc |
|
change next N lines, starting from current, till Esc |
Deleting Text
Command |
Action |
|---|---|
|
delete single char under cursor |
|
delete N chars from cursor |
|
delete one word, from the char under cursor |
|
delete N words, from the char under cursor |
|
Delete rest of the line, from the char under cursor |
|
delete current line |
|
delete next N lines, starting from current |
Copy Paste Text
Command |
Action |
|---|---|
|
copy current line to buffer |
|
copy next N lines, including current, into buffer |
|
Paste buffer into text after current line |
|
undo previous action |
Searching Text
Command |
Action |
|---|---|
|
search forward for string |
|
Search backward for string |
|
move cursor to next occurance of string |
|
move to previous occurance of string |
:se nuto set line numbers:se nonuto unset line numbers