On 4/4/07, ben lieb <[EMAIL PROTECTED]> wrote:
The following map is used to do add span tags to highlighted text
in-line. My problem is that it only works sometimes, and I don't know why.

:map ,bb c<CR><CR><ESC>kpI<span><ESC>A</span><ESC>kJJ

The map works by cutting the highlighted text, putting it on its own
line, adding the tag to the front and the end of the line, and then
joining the lines.

Any thoughts on why this only works sometimes? I can't isolate what
conditions bring it about.

Can be several things.

1. To cancel possible influence of keyboard timeouts, map
the same rhs to the single-key combination -- like <F10>.
When ,bb dopesn't work, try <f10>. If <f10> works, it's related to
timeouts.

2. Change to vnoremap instead of map. This cancels possibble
effects or remapping of some chars in the rhs. I think you want to use
it in the visual mode, right ? Then use vnoremap.

3. When it doesn';t work, what exactly happens ? Is it totally ignored,
or works half-way ?

4. When it doesn't work, do ':map ,bb' to check whether it's still
defined and is rhs correct.

Yakov

Reply via email to