Previous Day's Notes | Back to main page | Next Day's Notes |
vi (doesn't rhyme with "pie") is the vi
sual mode of ex
. It looks like a full-screen editor (really isn't).
is vi
ex
in visual mode plus additional commands. It's still a buffer editor. However, if connection is lost while in vi
, it will send you email and ask you if you want to recover your interupted session and will show you what to do.
Must be on the proper terminal (VT100, which is the most popular terminal ever. It's the standard emulation. If you can use the "talk" command, you can use vi
.
(If you still have problems connecting, try typing: set term vt100 (while logged on to Clyde.))
You will never be finished learning vi
. Make it a point to learn a new command every day you use vi
.
To invoke vi
, type:
vi [ENTER]
starts off in command mode only.
There are two modes of
vivi
: command mode and text entry mode.
**To exit from any text entry mode, hit [ESC]
**
There are 4 ways to exit vi:
:x
-Leave. If a filename is specified, buffer will be saved before leaving.
:wq
-Save, then quit. (wq file.name if filename hasn't already been specified.)
ZZ
-Save, then quit.
q!
-Don't save, then quit.
When in command mode, you don't see the commands on the screen. The [DELETE]
key will let you abort from a partially-typed command, or you can just hit [ESC]
.
[ENTER]
is not usually used for entering commands.
:set
commands
8-11 (Lefthand)
:set x
|
Enable option x. Disable option x. Give value to option x. Show changed options. Show all options. Show value of option x. |
:set showmode
(:set noshowmode)
:set nu
(:set nonu)
:set all
A | Append by moving to end of line and enter text-entry mode after last character. |
a | Append by entering text-entry mode after character the cursor is on. |
dd | Delete line that cursor is on. | #dd | Delete # of lines starting with the line the cursor is on. Many commands can be preceded by a number to indicate how many lines are to be affected by the command. |
D | Erases everything from charactor cursor is on to the end of the line. |
u | Undo last command. (The newer versions of Linux have multiple undos. |
U | Restore current line, discarding changes. |
i | Insert in front of character that cursor is on. |
x | Deletes character the cursor is on. (Can also use: #x, where # is the number of characters to delete in one swell foop.) |
I | Insert at beginning of the line the cursor is on. |
o | Open mode: opens a new line after the line the cursor is on. |
O | Open mode: opens a new line before the line the cursor is on. | r | Replaces the single character the cursor is on without changing to text-entry mode. |
R | "Overtype" mode: writes over existing characters until you hit [ESC] to leave this mode. |
~ | Changes the case of the letter the cursor is on when typed. |
J | Join current line with previous. |
5J | Join 5 lines. |
! | Shell commands. |
[CTRL-l] or [CTRL-r] | Clears screen from interuptions (messages from other users). |
de | Delete from cursor to end of line. |
dM | Delete from cursor to middle of screen. |
dG | Delete from cursor to end of file. |
d^ | Delete from cursor to beginning of line. |
d0 | Delete from cursor to first column of line. |
yw | Yank one word (that cursor is on). |
P | Paste from anon buffer before cursor. |
p | Paste from anon buffer after cursor. |
cw | Change entire word (cw[ENTER] then type new word, then press [ESC] to exit). |
Previous Day's Notes | Back to main page | Next Day's Notes |