Vi Quick Reference
There have been many times when I wanted to have a quick guide on how to use pocket vi text editor, and as I'm not the only one who has trouble remembering all the commands of vi, here I leave my
Quick Reference: Pocket Guide Vi
Modes
Vi has two modes, insert mode and command mode. The editior starts in command mode, where cursor movement, editing, copying and pasting text occurs. The insertion mode starts to enter a command Insertion or change. [ESC] takes us back to command mode (where we can go, by typing: q!).
Most of the commands are executed to write, except colon commands, which execute when you press enter.
Basic Commands
| : X | Exit, saving changes |
| : q | Exit long as is not made any changes |
| ZZ | Exit and changes exist, save |
| : q! | Exit and ignore the changes. |
To delete text in vi, you type d followed by a movement command. For example, dw deletes a word. Other commands to remove:
| x | Deletes the character to the right of the cursor |
| X | Deletes the character to the left of the cursor |
| D | Delete to end of line |
| dd | Deletes the current line |
| : d | Deletes the current line |
Just as the action of deleting text, copying is done by typing the letter y followed by a movement command. For example, y$ copy all the text until the end of the line. A couple of commands for copying to vi, are:
| yy | Copy the current line |
| : y | Copy the current line |
The change command is a delete command that left the editor in insert mode. It is used by adding a movement command after the letter c For example, cw changes a word.
| C | Change to end of line |
| cc | Change the whole line |
p | Paste after the position or the line |
P | Paste before position or before line |
Buffers
The memory buffers can be specified before any delete command, change, copy or paste. Usually the prefix has the form "c where c is any lowercase character. For "adw deletes a word and saves it into the buffer in order to be attached later via "ap
Bookmarks
Markers can be named in any line of a file. Any lowercase letter may be the name of a marcador.Los markers are also used as range limits.
| mc | Sets the marker c on this line |
| `c | Go to the top of the line brand c |
| 'c | Go to first character that is not a blank space of the line brand c |
In this article we will discuss Vi:
- Searches
- Regular Expressions
- File Handling
Popularity: 4%






























Thank you, I served pretty ³ Guide is your command
Buena onda!
Chiquito jejeje ... which is the world .- How did you find?
hmm .. Therefore I was looking for a manual and full vim commands that reminded me © º n alga time ago I saw this post here ...
saved my life as I thank you for the article