0 (zero)??”Moves the cursor to the beginning of the current line.
$??”Moves the cursor to the end of the current line.
H??”Moves the cursor to the upper-left corner of the screen (first line on the screen).
TIP
76
Linux First Steps Part I
M??”Moves the cursor to the first character of the middle line on the screen.
L??”Moves the cursor to the lower-left corner of the screen (last line on the screen).
The only other editing you need to know is how to delete text. Here are a few vi commands for
deleting text:
x??”Deletes the character under the cursor.
X??”Deletes the character directly before the cursor.
dw??”Deletes from the current character to the end of the current word.
d$??”Deletes from the current character to the end of the current line.
d0??”Deletes from the previous character to the beginning of the current line.
To wrap things up, use the following keystrokes for saving and quitting the file:
ZZ??”Save the current changes to the file and exit from vi.
:w??”Save the current file but continue editing.
:wq??”Same as ZZ.
:q??”Quit the current file. This works only if you don??™t have any unsaved changes.
:q!??”Quit the current file and don??™t save the changes you just made to the file.
If you??™ve really trashed the file by mistake, the :q! command is the best way to exit and
abandon your changes.
Pages:
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239