Wednesday, November 23, 2011

Justifying a Block of Code

v - to select the block
< > - to move the block one tab left or right
. - repeat the previous command

Commenting/Uncommenting a block of text

Commenting:
Ctrl-v to select the first characters of the block.
Shft-i for insert mode
Put the %, then hit Esc

Uncommenting:
Ctrl-v to select the first characters and 'x' to delete them. 

Tuesday, November 15, 2011

Moving the cursor

w    goes word by word
b     goes back word by word
(      Move a sentence back
)      Move a sentence forward
{     Move a paragraph back
}     Move a paragraph forward
0     Move to the beginning of the line
$     Move to the end of the line
1G   Move to the first line of the file
G     Move to the last line of the file
nG   Move to nth line of the file