Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
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 <ENTER>
- Normal mode
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 <ESC> will always return you to Normal mode.
- Insert Mode
To insert allow you to insert text. Type: 'i to enter insert mode. Press <ESC> to exit insert mode and enter Normal mode.
- Moving the cursor
The cursor is moved using either the arrow keys or the hjkl keys.
- h (left) j (down) k (up) l (right)
- Open a File
To open a file(from the % prompt) type: vim FILENAME <ENTER>. To open a file in vim type
- <ESC> :n fileName <ENTER>
To exit Vim type:
- <ESC> :q! <ENTER> to trash all changes.
- <ESC> :wq <ENTER> to save the changes.
- Edit text
To insert text at the cursor while in Normal mode type:
- i type in text <ESC>
- NOTE: Pressing <ESC> will place you in Normal mode or will cancel an unwanted and partially completed command.
- In Normal mode type: u
- Return line to its original state
- In Normal mode type: <SHIFT>-U
- Redo (undo the previous undo)
- In Normal mode type: <CTRL>-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 <ENTER>
- parts of this page where derived from man VIMTUTOR(1)