1

Re: Learning Idea: Before & After

I like ViEmu and wish I could use it in Windows Explorer.  ;-)  Find and Next are really powerful, as are zt, zb and zz.  But most of the power is going unused and I'm wasting time!

What I wanted to do today easier / faster was select a half-dozen lines, then in that selection replace every "foo" with "bar".   What's a good way to do this?

Which got me rethinking about a learning resource I have not found yet.  Picture a form with these main features.
   - Code Before Effective vim'ing
   - Code After Effective vim'ing
   - The Goal: "This editing can be done in XX keystrokes."
   - An area to attempt to edit Before into After.  It can be reset to Before at any time to try again / practice.
   - Three buttons: "Hint 1", "Hint 2" and "Tell me how".

It would be cool
   - if there was a treeview to the left with tasks by category,
   - if experts could offer alternatives,
   - if one could set up a practicelist where for example new tasks would be added automatically and learned tasks would be dropped when done 5 times in under 10 seconds,
   - etc.

A set of text files could work.  The GVIM $tutor$ is a start but it's too short.

If this is to succeed it needs experts to idiots.  I can supply one of the latter.  ;-)

Any thoughts, or links to similar tools?

2

Re: Learning Idea: Before & After

I also miss using vi/vim in Windows Explorer, although that's probably too far out of reach smile

A good way to do a limited-range selection is the following:

1) Go into visual-lines mode with V, then move around until the desired range is highlighted
2) Type ':'. You'll see that vim/ViEmu goes into ex mode, but the command line starts with the following:

  :'<,'>

This means the range between marks "<" and ">", which are the automatic built-in marks between the visual range endpoints (you could type :'a,'b to do whatever ex command between those marks).

3) Type the substitution command, say, "s/foo/bar/g", so the command line will look like this:

  :'<,'>s/foo/bar/g

The "g" option to :s ("global") means "substitute every match in each line, instead of just the first (which is the default)"

4) Type return, and the substitution should be done as expected.

As for the learning resource you mention, that is a very cool idea. I thought about something similar at some point, although less realistically doable. Something that would "watch" and "suggest" while you are editing (say, a message below saying "what you have just done could have been done with command xyz and uvw in less keystrokes, click for a demo and explanation").

Unfortunately, right now I don't have the resources now to implement such a learning resource myself, but I would be very happy to colaborate: help out with content, provide hosting space, provide exposure via my blogs, the ViEmu web site, and possibly a mailing to all customers, etc...

Regards,

  -- Jon