How to use vim, quick tutorial

this is a quick tutorial on howto use vi, or vim. It will get you started, so you open, edit, and save files.

For an interactive tutorial type: vimtutor 

=Basics= When vim starts up, you will be in Normal mode. Normal mode is not for inserting text into your file but allow you to preform many operations, like saving and exiting. Pressing  will always return you to Normal mode.
 * Normal mode

To insert allow you to insert text. Type: 'i to enter insert mode. Press  to exit insert mode and enter Normal mode.
 * Insert Mode

=Basic Operations= The cursor is moved using either the arrow keys or the hjkl keys.
 * Moving the cursor
 * h (left)      j (down)       k (up)       l (right)

To open a file(from the % prompt) type: vim FILENAME . To open a file in vim type
 * Open a File
 *   :n fileName   

To exit Vim type:
 * Exit
 *   :q!     to trash all changes.

OR type:
 *   :wq     to save the changes.

To insert text at the cursor while in Normal mode type:
 * Edit text
 * i    type in text     


 * NOTE: Pressing  will place you in Normal mode or will cancel an unwanted and partially completed command.

=More Operations=
 * Undo
 * In Normal mode type: u


 * Return line to its original state
 * In Normal mode type: -U


 * Redo (undo the previous undo)
 * In Normal mode type: -R


 * Delete line
 * In Normal mode type: dd


 * Delete word(under the cursor)
 * In Normal mode type: dw


 * Delete character(under the cursor)
 * In Normal mode type: x


 * Delete from the cursor to the end of the line
 * In Normal mode type: d$


 * Find word(or string)
 * In Normal mode type: /theWord 

=See Also=
 * vimtutor
 * man vim
 * The Vim Wiki

=Credits=
 * parts of this page where derived from man  VIMTUTOR(1)

From HowTo Wiki, a Wikia wiki.