A.J.Mechelynck wrote:
Wim R. Crols wrote:
Hi,

How can I apply a macro on a set of selected lines? I have a simple mapping under <F4> (aligment of '=' on the same column, but it's not really important)

:map <F4> 0f=60i <Esc>D60<Bar>p

and I want to execute it for every line in a Visual Line selection. I tried this

:'<,'>normal <F4>

But there was no effect. Is there an alternative, please?

Thank you,
Wim



Possibility 1:

    :'<,'>exe "normal \<F4>"

Possibility 2:

    :'<,'>normal (hit Ctrl-V)(hit F4)

where (hit Ctrl-V) means "hit Ctrl-V unless your Ctrl-V is remapped to paste from the clipboard, in which case you should hit Ctrl-Q instead".
These two options didn't do anything here, I'm afraid.
Possibility 1 gives me the error E481: no range allowed.
Ctrl-V isn't remapped (I don't use the Windows mappings, although I do use Windows, ViM 7.0) and pressing it like you describe in Possibility 2 just puts "<F4>". Executing it doesn't have any effect either.

Tnx,
Wim

Reply via email to