4th(VI editor) s
4th(VI editor) s
Practical -04
Aim- To study vi editor in detail.
VI EDITOR: - The default editor that comes with the UNIX operating system is called vi (visual editor).
Using vi editor, we can edit an existing file or create a new file from scratch. we can also use this editor
to just read a text file.
There are three modes in vi editor.
1. Command Mode.
2. Input/Insert Mode.
3. Ex-Mode/Ex-command Mode.
1. Command Mode: - In command mode, actions are taken on the file. The vi editor starts in
command mode. Here, the typed words will act as commands in vi editor. To pass a command, you need
to be in command mode.
2. Insert Mode: - In insert mode, entered text will be inserted into the file. The Esc key will take
you to the command mode from insert mode.
3. Ex-Mode: - This mode enables you to perform tasks such as saving files, executing commands.
7. r :- Replace single character under the cursor with the next character typed.
9. s: - Replaces single character under the cursor with any number of characters.