|
The article has important material for use Vi, but only cover a part of Vi capacity. Vi is present in all UNIX (AIX, HP-UX, BSD, System V, IRIX, GNU/Linux) and other system as DOS, Windows and OS/2.
Enter and leave the editor.
Write 'vi' in the shell and push INTRO, now the editor is open. The screen don`t have menus, indications and animed iconos consumming memory. Vi has 2 ways: Command and Insertion. The operations of command way are: write or read, search and sustitutions. The second way is for insert text in the editor.
For pass of Insertion to Command way push ESC. If you are in Command way, push the letter ' i '. And ' A ' put the cursor in endline.
For leave the editor you need the Command way. Then write ' :q! ' and push INTRO.
Write text.
you should to be in Insertion way, now write any lines and if you want leave the editor with ' :q! ', you will have a msg that indicate you should save of file. For save the file write ' :w filename ', when the file is saved and you modificate the text you can leave with ' :wq! ' (write and quit).
Basic Commands
| :q! | Leave vi without save the modifications. |
| :wq! | Write and quit. |
| ESC | Activate the Command way |
| i | Activate the insertion way |
| R | Activate the replacement way |
| gh | Activate the selection way |
| h | Move the cursor to left |
| j | Move the cursor to down |
| k | Move the cursor to top |
| l | Move the cursor to right |
Customer the editor
There are any command that can modificate the functioning of editor. For example, write ' :set number ', you will see that the lines appears enumerates. with ' :set ruler ' you see that in the right appears the column and row of the cursor.
If you want to meet your way of work, write ' :set showmode '. For disactivate the options write 'no' before the command, for example: if you don't want that the lines appears enumerates, write ' :set nonumber '.
|