[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: Beginner's vim tutorial



On Thu, Jan 10, 2002 at 10:27:39PM -0600, Donald R. Spoon wrote:
 
| 2. I have always had problems at the start remembering keyboard commands 
| on ANY wordprocessor / editor that I have ever tried.  VI/VIM has been 
| especially perplexing because I cannot determine the under-lying logic 
| used in its design.  This means I am constantly in the "help" section 
| and reading the docs and never get any work done.  Eventually I give up 
| and go to something that I have already learned and use it.  Are you 
| aware of ANY documention that will give a historicaly perspective about 
| VI/VIM?  How did it evolve?  Why was this particular set of commands 
| chosen?  Is there any "logic" (neumonics?) available to help remember 
| important commands for the beginner? (Example:  Wordstar's command keys 
| were layed out in a geometric manner on the keyboard.  Once I knew this 
| I could usually figure out a command sequence and NOT have to refer to 
| the docs/help menus nearly as much.)

It does help to have some sort of mnemonic or other device to help
remember the commands.  I don't know much of the history for the
individual commands, but I can help with this much :

Put your hands on the home row.  Now take your right hand :
    hjkl
are the cursor movements ( left , up , down , right ).  The names are
meaningless, but the position is natural.

To enter "insert" mode :
    i   Insert (left of current cursos)
    I   Insert (far left (beginning) of line)
    a   Append (right of current cursor)
    A   Append (far right (end) of line)
    o   Open a new line (below cursor)
    O   Open a new line (above cursor)

    d<motion> Delete characters touched by <motion> (where <motion> is
                    some motion command.
                Eg "dG", deletes from here to the end of the buffer
    dd      Delete current line (same as '0dj')
    x       Delete current character (don't know why this key, just
                remember it) (same as 'dl')
    p       Paste buffer here (right/below cursor)
    P       Paste buffer here (left/above cursor)

    :s/<pattern>/<text>/<flags>
            Substitute the text matched by <pattern> with <text>,
                semantics controlled by <flags>

Many of the commands have some sort of meaning to them, if you have
the right name for the operation.  Other commands are what they are
due to key position on the keyboard (simple cursor motion).

Keep at it and just use the editor.  All you need to get started is
the cursor, 'i', 'x', and 'dd'.  Everything can be done with just
those commands (it will just be like using notepad in a difficult
manner).  Once those commands become more natural, look up some of the
more complex operations (such as substitute) and practice with them
until you understand what it does.  The best thing, in my experience,
is to explore what sort of commands exist, but don't try to really
learn them until you plan on using them.  When you have a need for a
command you are likely to learn it better and easier.

-D

-- 

A)bort, R)etry, D)o it right this time



Reply to: