Prev | Current Page 226 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

Before you can add or change text in the file, you have to
type a command (one or two letters and an optional number) to tell vi what you want to do. Case
is important, so use uppercase and lowercase exactly as shown in the examples! To get into input
mode, type an input command. To start out, type either of the following:
 a??”The add command. After it, you can input text that starts to the right of the cursor.
 i??”The insert command. After it, you can input text that starts to the left of the cursor.
When you are in insert mode, -- INSERT -- will appear at the bottom of
the screen.
Type a few words and then press Enter. Repeat that a few times until you have a few lines of text.
When you??™re finished typing, press Esc to return to command mode. Now that you have a file with
some text in it, try moving around in your text with the following keys or letters:
 Arrow keys??”Move the cursor up, down, left, or right in the file one character at a time.
To move left and right, you can also use Backspace and the spacebar, respectively. If you
prefer to keep your fingers on the keyboard, move the cursor with h (left), l (right), j
(down), or k (up).
 w??”Moves the cursor to the beginning of the next word.
 b??”Moves the cursor to the beginning of the previous word.


Pages:
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238