lunes, agosto 10, 2009

Vim-Basics Tutorial











Vim has a particular working method. Indeed there are to main mods : command and other mods.

Command mod lets you select the mod you want to enter to, save, quit, copy, paste and that kind of things but you can't edit the file in this mod.

There are several other mods. I'll only speak about those I often use.

Insert mod : lets you insert text in a document. Shotcurt : "i" (insert where the cursor is) or "o" (insert at the beginning of the following line).

Visual mod : permits to select the text like you would do with a mouse but using the keyboard instead of the mouse. Useful to copy several lines for example. Shotcurt : V

Let's now speak about the command mod.

A command begins with the symbol ":".

When you are in another mod you can use the escape key (sometimes you'll need to hit it twice) to come back to command mod at any time.

save : :w
save and exit : :wq
exit : :q
force : ! (example :w! :q!)
vertical split : open a document and then type :vsplit /path-to-document/document and this will open the specified document and split the screen so you can see both documents.
copy : y
copy a line : yy
paste : p
cut : d
cut a line : dd

link: HowtoForge



No hay comentarios: