Thursday, January 23, 2014

Visual Editor (vi) shortcuts


Insert
VI
i Inserts text to the left of the cursor. +       –
I Inserts text at the beginning of the line, no matter where the cursor is positioned on the current line. +       –

Append
VI
a Begins inserting after the character (append) on which the cursor is positioned. +       –
A Begins inserting at the end of the current line, no matter where the cursor is positioned on that line. +       –

Open
VI
o Begins inserting text on a new, empty line that is opened for you, below the current line. This is the only command that will allow you to insert text BELOW the LAST line of the file. +       –
O Begins inserting text on a new, empty line that is opened for you, above the current line. This is the only command that will allow you to insert text ABOVE the FIRST line of the file. +       –

Deleting,copying and changing
VI
d Delete text. (see explanation above) +       –
y Copy text (that is, yank it into a holding area for later use). (see explanation above) +       –
c Change text from one thing to another, which you will type. (see explanation above) +       –
! Filter text through a program. +       –
< Shift a region of text to the left. +       –
> Shift a region of text to the right. +       –

Single Key Movements
VI
h Move cursor to the left one character. +       –
l Move cursor to the right one character. +       –
j Move cursor down one line. +       –
k Move cursor up one line. +       –
^ Move cursor to the beginning of the line. +       –
$ Move cursor to the end of the current line. +       –
1G Move cursor to the first line of your document. Other numbers will move to the line specified by number (ex. 50G goes to the 50th line).