Dummkopf's guide to vim

Knapp magick.crow at gmail.com
Sat Sep 13 16:48:41 UTC 2008


Dummkopf's guide to vim by Douglas.

First vim, also know by the old name of vi, is know to be hard to use.
This is because it has more commands and power than any other editor
that is common. It is hard to use because it starts in command mode.
This is IMOHO stupid. It should start in edit mode because that is
what most people are used to. Of course getting out of it might prove
a challenge for those that don't know to use the esc key. So on to the
basics.

Ubuntu often does not have full vim installed, so do that first.

sudo vim -p <file-name> <more-names>
No, you don't have to use sudo unless you want to edit a system file.

:tabe <file-name> This loads a new file in a new tab.

Move the cursor around with the arrow keys, you can also use hjkl, if
you are hardcore.
page up and page down also work.

dd deletes current line.

y to yank it (copy it).

p to put or paste it.

5dd deletes 5 lines including current line.

r<new charater> changes character under cursor

i or insert key enters edit mode. (Edit mode is just like Kate or word
or whatever.)
pressing r changes to replace mode as does pressing the insert key 2 times.

You can also use the mouse and us visual mode but I will let you play with that.

esc exits edit mode

:wq (writes (saves) the file and quits)

:w <new-file-name>

:q! quits no matter what is wrong, like an unsaved file.

I bet there is not much more that you do with Kate most of the time. Am I wrong?

For more check this out.
http://tips.webdesign10.com/another-vim-tutorial

You can also type vimtutor to get that.

:help :substitute will give you help with search and replace in turs
(sp?) vim help file format.

-- 
Douglas E Knapp

http://sf-journey-creations.wikispot.org/Front_Page




More information about the ubuntu-users mailing list