Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Writing a Filter::Simple -based filter for .vim

by Intrepid (Deacon)
on Aug 17, 2003 at 13:12 UTC ( [id://284410]=note: print w/replies, xml ) Need Help??


in reply to Re: Writing a Filter::Simple -based filter for .vim
in thread Writing a Filter::Simple -based filter for .vim

Anyway, I that's how I would approach this problem. Let me know if you decide to start working on a VIM::Emulate module. I would be willing to assist, whenever I have time.

Excellent! Thank you. I am quite short on time myself right now, so I'll have to keep this reply brief.

One thing I'd like to mention is how great the insight you've provided is, regarding one issue. Your lattermost suggestions hinge on the understanding that Vim is creating a persistent perl interpreter that is lasting the lifetime of the Vim script: as far as I knew, it was not, and so it never occured to me to try to do this. I had thought that Vim creates an interpreter for each block of Perl code, it does its work and then expires. I was wrong!

The example you posted above in fact proves out nicely, so thanks again for the very helpful insights. I'll be in touch!

    Soren/Intrepid

-- 
use PerlMonk::Tye qw(:wisely);
  • Comment on Re^2: Writing a Filter::Simple -based filter for .vim

Replies are listed 'Best First'.
Re3: Writing a Filter::Simple -based filter for .vim
by bbfu (Curate) on Aug 19, 2003 at 03:50 UTC

    Vim is creating a persistent perl interpreter that is lasting the lifetime of the Vim script

    Actually, the perl interpreter is lasting for the entire life of the VIM instance, as evidenced by the fact that you can declare Perl functions in one .vim script and call them in a different .vim script.

    This, of course, leads to the logical solution for the parsing-via-stand-alone-perl issue: move your functions into a module (or even just a required .pl script), and use the module in you .vim script. This would probably work out better in the long run than even in-lining Perl code in the .vim script and using the -x option, as you could then re-use the Perl code. Then, you'd need only create the VIM emulation module.

    bbfu
    Black flowers blossom
    Fearless on my breath

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://284410]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found