Tutorial 4 | VI Editors | Jump to PICO Editors tutorial
The aim is to change the contents of the file and vi offers a very large set of commands to help in this process.
This section will focus on adding text, changing the existing text and deleting the text. At the end of this section you will have the knowledge to create any text file desired. The remaining sections focus on more desireable and convenient commands.
When entering text, multiple lines can be entered by using the [ return ] key. If a typing mistake needs to be corrected and you are on the entering text on the line in question. You can use the [ backspace ] key to move the cursor over the text. The different implementations of vi behave differently. Some just move the cursor back and the text can still be viewed and accepted. Others will remove the text as you backspace. Some clones even allow the arrow keys to be used to move the cursor when in input mode. This is not normal vi behaviour. If the text is visable and you use the [ ESC ] key when on the line you have backspaced on the text after the cursor will be cleared. Use your editor to become accustomed to its' behaviour.
- a Append some text from the current cursor postion
- A Append at the end of the line
- i Insert text to the Left of the cursor
- I Inserts text to the Left of the first non-white character
on current line - o Open a new line and adds text Below current line
- O Open a new line and adds text Above the current line
