Loading ...
Sorry, an error occurred while loading the content.

Re: Extending Scripting By Using Perl, Python, Tcl, and Ruby (Att:Colin Keith)

Expand Messages
  • Roger_15@hotmail.com
    ... From: Colin Keith To: Sent: Sunday, September 01, 2002 3:13 PM Subject: Re: Extending Scripting By Using Perl,
    Message 1 of 2 , Sep 2, 2002
    • 0 Attachment
      ----- Original Message -----
      From: "Colin Keith" <vim@...>
      To: <vim@...>
      Sent: Sunday, September 01, 2002 3:13 PM
      Subject: Re: Extending Scripting By Using Perl, Python, Tcl, and Ruby


      > On Sun, Sep 01, 2002 at 04:54:51PM +0000, The Vim Man wrote:
      > > far as I know, all the scripts currently on vim.sourceforge.net just
      > > use Vim's own scripting language. How powerful can you make Vim (what
      > > funky things can you do) when you combine Vim with one of the above
      > > scripting languages? Thanks for your time...--
      >
      > *urm* They are there. Look through the newsgroups might be a little more
      > revealing. I konw I've certainly posted a few suggestions to questions
      > using Perl (althought not lately because I've been too busy). You can do
      > anything with the interpreters embedding into Vim that you can do with
      them
      > stand alone. So if you know how to use Perl (python, ruby, etc.) you can
      > use it from in Vim. What makes the embedded interpreter better than using
      > the same language externally is the fact that you can updating your file
      > and notify the user without relying on awkward calls to external programs
      > (although Vim handles those beautifully as well). The trick is to find a
      > use for these extensions, but since Vim is a text editor it can be
      > limiting. Whilst you may use Perl to parse your system logs nightly, but
      > you wouldn't write an interface for doing it from Vim because you don't
      use
      > Vim like that.
      >
      >
      > You might write a hmm...
      >

      *snip*

      > * On windows you might want to use Win32::TieRegistry to access the
      > registry so you could:
      >
      > :e registry://HKCR/.txt
      >
      > You could then set the filetype association for .txt files to
      > vim_auto_file. When you've changed it, save and it updates the
      registry -
      > (WARNING! Don't muck about with your registry if you don't know
      _exactly_
      > what you're doing)

      *Snip*

      Hi Colin,
      Could you elaborate on this a bit? This sounds interesting
      and being new to Vim
      on Windows I'm always looking for goodies like this.

      Thanks!

      Roger.
    • Colin Keith
      ... I actually decided to put my money where my big mouth is (so to speak) and wrote a ftplugin for doing just this. Its taken a while mostly because I ve been
      Message 2 of 2 , Sep 16, 2002
      • 0 Attachment
        On Mon, Sep 02, 2002 at 09:17:21AM -0500, Roger_15@... wrote:
        > Could you elaborate on this a bit? This sounds interesting and being new
        > to Vim on Windows I'm always looking for goodies like this.
        >
        > Thanks!
        > Roger.

        I actually decided to put my money where my big mouth is (so to speak)
        and wrote a ftplugin for doing just this. Its taken a while mostly because
        I've been busy, but partly because I was being stupid and missed such a
        simple solution. Oh, and because Vim has a few gotchas which as far as I
        could tell are due to the way the scripts are parsed (remember I was asking
        why $a++ wasn't working the other week? it seems to be similar to that)

        Anyway, if you're interested its available on:

        http://vim.sourceforge.net/script.php?script_id=418

        I will warn you though - especially since you say you're new to windows -
        it does read and write from your registry. That means it has the potential
        to screw it up and trash your machine. I take *no* responsibility for it
        doing that to anyone's machine. This is mostly just playing around to see
        what can and can't be done. It isn't overly complex, and works happily for
        me, but...

        At some point (like when I have some sleep - where did the evening go?)
        I'll jot down some notes on using Perl from Vim and if I can think of
        enough I might put them into a web page so no one elses asks the same
        question I did the other week. For example one thing that irritated me for
        a while was the total lack of error messages, until I realised you actually
        needed to catch them :)

        'nyway, in case anyone is bored enough to look :)

        Col.


        --
        First Name: Colin, one 'ell', not two. Increase your font size if you
        thought it had two. Pronounced: Col-in, not Cooo-lin
        Surname: Keith. Yes surname, not forename. Its the name of a Scottish clan
        that once owned half of Scotland...
      Your message has been successfully submitted and would be delivered to recipients shortly.