[vox-tech] vim question: making mapping atomic w.r.t the '.' command

Mitch Patenaude mrp at sonic.net
Tue Nov 30 14:32:24 PST 2004


> This macro works, but you have to position the cursor on the beginning 
> of the
> word, otherwise, you end up with only a part of the word emphasized.  
> Another
> strategy would be:
>
>    1. Find the previous space character.
>    2. Move the cursor right by one.
>    3. Then change the word.
>
> Here would be that strategy expressed as a macro:
>
>    :nmap gfe F lcw\empf{<esc>pa}<esc>

Why not use the 'b' command, which finds the beginning of a word, and 
works for words at the beginning of a line as well.

:nmap gfe bcw\emph{<esc>ea}<esc>

   -- Mitch



More information about the vox-tech mailing list