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

Re: vim: first letter of last word on line ???



On Tue Feb 25, 2003 at 09:05:25PM -0600, the boisterous
Michael D. Schleif <mds@helices.org>
wrote to me:
> It seems that I'm always in vim trying to goto the first letter of the
> last word on a line.
> 
> Is there already a key binding to do that?
> 
> The closest I've found is Esc A Esc B ; but, that is really (3+)
> keystrokes ;<

Well a 3 stroker is this:
ESC $ B

$ jumps to the line end, B jumps to the first character of last word.

To construct a macro, hit
ESC q L $ B q

You can replace L with a character more convenient for you.

Then a sequence of
@ L
activates this macro named L and you will end up placed at the beginning
of last word. If you want to be automagically in INSERT mode, place an i
before the last q in macro recording mode.

so long
Thomas

-- 
  ___    Obviously we do not want to leave zombies around.
_/___\     - W. Richard Stevens
 ( ^ >   Thomas Krennwallner <djmaecki at ull dot at>
 /   \   1024D/67A1DA7B 9484 D99D 2E1E 4E02 5446  DAD9 FF58 4E59 67A1 DA7B
(__\/_)_ http://bigfish.ull.at/~djmaecki/

Attachment: pgpZFNIzZgi_v.pgp
Description: PGP signature


Reply to: