This page has been translated from Spanish

...::: Guatewireless.org ::::..

Technology, Software Libre, Guatemala, Open Source, Linux, Wireless, WiFi, Scripting, Debian, CentOS, Gentoo, Redhat, SuSE, Windows

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

Leaving the Vi Editor

: 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.


Inserting text

i Insert before cursor
I Insert before line
to Add after the cursor
A Add after line
or Open a new line after current line
Or Open a new line before current line
r Replacing a character
R Replace multiple characters


Movement inside the editor

h Move left
j Move down
k Move arrriba
l Move to the right
w to the next word
W to the following word separated by a space
b the beginning of a word
B the beginnings of words delimited by a space
e the end of the word
E the end of a word delimited by space
( a prayer backwards
) a sentence forward
( back a paragraph
) a paragraph forward
0 to the top of the line
$ the end of the line
1G the first file
G the last line of the file
nG Moverese to line n of Achieve
: No to line n of Achieve
fc forward to find the following point
Fc back to the point c
H the top of the screen cap
M half of the screen
L the top bottom of the screen
<span> %</span> until (), (), [] associated



To delete text in vi, you type d followed by a movement command. For example, dw deletes a word. Other commands to remove:

Deleting Text

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:

Copying Text - Yanking

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.

Changing Text

C Change to end of line
cc Change the whole line

Pasting Text

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%



Tagged as:

4 Comments

  1. Thank you, I served pretty ³ Guide is your command ;)
    Buena onda!

  2. saved my life as I thank you for the article : D

Please enter a comment

Please note the following:
Comments are moderated, so it can take in being published. No need to repeat his comment.
Your email will never be revealed.

Search terms


  • vi delete line
  • delete lines in vi
  • vi delete
  • vi command centos
  • vi delete character
  • delete in vi
  • vi delete line
  • delete line in vi
  • vi delete line
  • vi command centos
  • vi add line
  • vi delete point
  • vi delete paragraph
  • vi centos
  • remove lines in vi
  • vi delete character
  • vi add line
  • vi commands ubuntu
  • quit vi centos
  • vi command in centos
  • ubuntu vi
  • comentarizar in vi editor
  • vi commands ubuntu
  • vi remove
  • vi delete line
  • delete a character in vi
  • out keeping in vi
  • how to delete in vi
  • vi delete text
  • vi delete lines
  • add line vi
  • vi delete line
  • vim command centos
  • vi commands
  • vim quick reference manual
  • vi delete
  • vi quick reference
  • delete character in vi
  • vim command reference manual
  • centos linux vi commands
  • vim regular expressions reference
  • linux vi copy a character
  • vi manual ubuntu
  • as comment lines in vi
  • Ubuntu Quick Reference
  • remove blanks with vi editor
  • delete line in vi
  • remove markers amarok
  • vi delete to the end
  • Commenting on a linux vim line
  • command to paste a text mode Text Center
  • vi commands delete
  • As a comment on one paragraph in the vi editor
  • centos vi
  • vi eliinar character
  • vi command centos
  • as clear lines in vi
  • vi copy a character
  • how to delete a character in vi
  • delete in vi