Running a function mutiple times in vim
Hey,
I've written a function in vim and it works great. I execute it as follows: Code:
:call Myfunc() TIA for any help, this is starting to hurt my head... -fudamn |
Check out the vimbook, page 356. It has an example of how to use a while loop in command mode to repeat some action multiple times. I suppose calling a function that way would work.
|
Look at this dot ~> .
Seriously :D In vi (i don't know about vim) you can run a command, like p(aste) and use the . (dot) to run the previous command again. Usually in vi the syntax format is like: :<number of times><command> So to repeat a paste three times do: yy first yank a line p paste it once . repeat the paste 3. repeat the paste three times So I think you can use: :call Myfunc() :3. Let me know if it works, ok? |
Thanks for reply fellas,
muha: Sorry the dot doesn't work on function calls. Good try though. :D bigrigdriver: Are you referring to the manual? Or the vim PDF book on their website? It's a bit late and I'm off to bed, but I'll check out your reference tomorrow. Thanks! -fudamn |
that's a shame indeed :P
|
All times are GMT -5. The time now is 09:41 PM. |