Text Editing using vi from the Console

by Lance Gold

This may be helpful when the Debian Server does not have vim

Return to index

Instructions from https://www.cs.colostate.edu/helpdocs/vi.html

$ vi filename edit filename starting on line 1
vi starts in command mode

vi is case sensitive

press <Esc> to exit insert mode

: (colon) moves cursor to bottom of screen
:x quit vi, save and quit
:q! quit without saving
moving the cursor (mouse doesn't move cursor)

^ (ctrl key)

j or
<return>
down a line
k up a line
h left
l right
0 start of current line
$ end of current line
^f down screen f=forward one screen
^b up screen b=back one screen
^d down half screen
^u up half screen
u undo
i insert before cursor, until <esc> pressed
a append after, until <esc> pressed
o insert line after current line o=open new line
O insert line before current line
r type over, r=replace single character until pressed
x delete character under cursor until pressed
dd delete line