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

Re: [RFC] Some more python and VimL interfaces

Expand Messages
  • ZyX
    ... Adding cryptic names is not a good idea. Also note that calling built-in functions it is not so common and will not become more common later. Most used
    Message 1 of 42 , May 15, 2013
    • 0 Attachment
      > Calling functions would be a very common thing. Thus I would keep the
      > name as short as possible: vim.f.bufnr('%')

      Adding cryptic names is not a good idea. Also note that calling built-in functions it is not so common and will not become more common later. Most used after examining sources of L9, Python-mode-klen, Gundo, clang_complete, ConqueShell, pyinteractive, threesomelib, powerline, ConqueGDB: get variable, set variable (obviously because it is the easiest way of interaction between python and VimL code aside from using bindeval), set option (but not get it; powerline is most extensive in getting options), call built-in function (bufnr and other buf*, feedkeys, expand, other), call external function (mostly via vim.command: second easiest way of interaction, used in case you don’t need reply from the function). Most used is calling random commands: :normal, buffer and window manipulations, other (setting variables and options was counted separately).

      Subitem “bufnr and other buf*” should be normally replaced with buffer objects manipulations (some more attributes are to be added). Item “call external function” should not exist in pure-python plugin. Removing this moves calling random functions to one of the last places. And note that getting rid of necessity to use VimL functions was claimed as one of the goals.

      > No, just the difference of passing the whole string to vim.eval vs.
      > processing the arguments in Python and passing the result of that to
      > Vim.

      It is already there.

      --
      --
      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.
    • 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
      • 0 Attachment
        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.