custom nmap not working with global (:g)?

0 views
Skip to first unread message

Reckoner

unread,
Mar 10, 2009, 11:25:48 AM3/10/09
to v...@vim.org
Hi,

I have the following map:

<F2> :call ToggleCppComment("#")<CR>

but when I try to do

:g/print/normal <F2>

it doesn't work the same as doing

:g/print/call ToggleCppComment("#")

what am I missing here?

thanks in advance.

Jürgen Krämer

unread,
Mar 10, 2009, 11:42:16 AM3/10/09
to vim...@googlegroups.com

Hi,

the <F2> after the normal command is not a not a reference to the
function key, but the sequence of the command <F2 followed by the
(incomplete) command >. To call your mapping you can try

:g/print/exe "normal \<F2>"

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

Reply all
Reply to author
Forward
0 new messages