Hi Bram! ... Please keep in mind: • Identifiers should tell for what purpose they have been created, otherwise the source code becomes unmaintainable. E.g.

Message 1 of 42
, May 16, 2013

0 Attachment

Hi Bram!

On 2013-05-15 Wednesday at 20:51 +0200 Bram Moolenaar wrote:
>
> ZyX wrote:
>
> [...]
>
> > >Would it be possible to have most Vim functions made callable from
> > >Python this way? Obviously it's much better than using vim.eval().
> >
> > I assumed it be a convenience wrapper replacing
> >
> > vim.bindeval('function("bufnr")')('%')
> >
> > (obviously, you can save `vim.bindeval('function("bufnr")')` result in
> > a variable) with a nicer syntax. I believe author of proposal assumed
> > the same.
>
> Calling functions would be a very common thing. Thus I would keep the
> name as short as possible: vim.f.bufnr('%')

Please keep in mind:

• Identifiers should tell for what purpose they have been created, otherwise
the source code becomes unmaintainable. E.g. in the Linux kernel XFS module
several function names are longer than 32 characters. Probably with reasons.
And if you object, no user needs to type this function names: think of debugger
sessions, think of grep commands in the source tree.

• The age of punch cards is over. Nowadays the common 80 columns limit is just
a habit without any technical reasons. Few people realized it, e.g. the Funtoo
Linux Project has a coding standard with line length up to 160 characters.

• Some people argue, short lines are convenient to read. Probably they don't
understand the consequences of “use it or loose it” for their memory.

--
Regards
Roland Eggner

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.