Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

4.Adding and deleting text

 

...

languagebash

...

vi

i

type some you want to add.

...

Code Block
languagebash
 :a   # Adds text after the cursor
 :A   # Adds test after the current line
 :i   # Inserts text before the cursor
 :I   # Inserts text at the beginning of the current line
 :o   # Inserts a blank line after the current line
 :O   # Inserts a blank line after before the current line

 :x   # Deletes one character under the cursor
 :X   # Deletes one character behind the cursor
 :dd  # Deletes the current line
 :5dd # Deletes five lines from the current line
 :r   # Replaces the character under the cursor
 :R   # Replaces the existing text 

 :y   # Copies the current line
 :p   # Pastes the copied line 
 :u   # Undoes the last change
 :U   # Undoes all changes on the current line

 

5. Importing files into vi:

 

Code Block
languagebash
vi vi_file
ESC
:r import_file

...