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

Re: [RFC] Some more python and VimL interfaces

Expand Messages
  • Andy Kittner
    ... Where it is feasible to implement it directly in python that sounds like a good idea to me since it would probably ease the future maintenance and allow
    Message 1 of 42 , May 11, 2013
      On Sat, May 11, 2013 at 03:50:50PM +0200, Bram Moolenaar wrote:
      > [...]
      >If most things are already possible, then it should be possible to write
      >Python functions that work as a nice interface for the functionality.
      >Thus not change the C implementation of the Python interface.
      Where it is feasible to implement it directly in python that sounds like
      a good idea to me since it would probably ease the future maintenance
      and allow more people to contribute to it.

      Though for some of the suggested additions I imagine that it will
      negatively impact the performance and/ or be difficult to implement (e.g.
      getting the escaping right for eval(), reliably parsing the output of
      commands etc.). But that's something where ZyX probably can give more
      qualified comments than I could.

      >
      >We also need to keep in mind that all the Vim functionality is nicely
      >documented and there are examples, while if we add a different way to do
      >this in Python this requires documenting how that works. Thus a script
      >writer will have two sets of functionality to learn to use. It will be
      >good to have "how it's done in Vim" to be very similar to "how it's done
      >in Python". Otherwise it gets very complicated.
      I see that differently, currently people will have to learn quite a bit of
      VimL to get anything useful done with the vim interface. For someone who is
      new to vim, but already knows python, a "pythonic" interface is much
      more useful then having to do eval("vimL_code()") all the time.
      Some of the people I converted to vim users will probably never touch
      VimL, but if it where possible to write plugins purely in python with a
      pythonic interface they could write plugins for themselves as well
      (since I also converted them to python ;))

      So, from that point of view the additions proposed by ZyX sound very
      good to me (whether implement in C or python, as long as it works "out
      of the box").

      Regards,
      Andy
      --
      On the sixth day God created man
      On the seventh day, man returned the favor.
    • Bram Moolenaar
      ... Yes, this also came up as a side effect of the os.chdir() solution. It s especially useful if a plugin can be distributed as a Python module plus some
      Message 42 of 42 , May 21, 2013
        Marc Weber wrote:

        > Yet another suggestion - what about adding &rtp to sys.path somehow ?
        > (with or without python version site-packages or the like)
        >
        > Then you could
        > - write .py files
        > - use them from python by
        >
        > import module
        > do_stuff()
        >
        > Yes - it can be trivially implemented in tools like vim-addon-manager,
        > but I'd prefer a global solution usable by everyone.

        Yes, this also came up as a side effect of the os.chdir() solution.

        It's especially useful if a plugin can be distributed as a Python module
        plus some lines in the Vim plugin. It would have a similar effect as
        using a Vim script under autoload.

        --
        A M00se once bit my sister ...
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.