(c)<h1>Headline</h1>
My cursor is denoted by (c). How can I most quickly jump to the start
of the "Headline" word?
Pressing w or e isn't any good, I still have to press at least three
times. Not nice, almost as bad as cursor keys.
Sounds like it's time to learn the f/F/t/T family of commands, if
you don't know/use them already. I use them so regularly that it
bugs me to use any other editor where I can't jump quickly to my
desired position in a line (namely...pretty much every other
editor that's not a modal/vi editor).
You can pop to their description at
:help f
You can use
fH
to jump to the "H" in "Headline". If you plan to insert stuff
before the "H", you can also use "f>" and then "a" to append...I
tend to use this more when editing HTML, as there's always a ">",
whereas the first letter changes with each CDATA item.
I use them so regularly that I also use the "," and ";" which
repeat the last f/F/t/T motion. I know a lot of folks don't use
the "," and ";" for such motions because I frequently see those
characters remapped or used as the 'leader' character.
In Vim7, there's also a text object for "tag".
:help v_at
:help v_it
which you can use for things like
gUit
which will force the contents of the tag to uppercase, or
cit
which will delete the contents of the tag and drop you into
insert mode to enter the replacement text.
Be sure to read the caveat at
:help tag-blocks
Just a few ideas for speeding up your editing...
-tim