Sunday, December 31, 2023

Re: ICCF?

On Sun, Dec 31, 2023 at 09:18:06PM +0100, Tony Mechelynck typed:

> On Sun, Dec 31, 2023 at 5:41 PM Steve Mynott <steve.mynott@gmail.com> wrote:
> >
> > (Apologies if this is a double post. I sent to vim@vim.org 3 hours
> > ago, and I don't see it appearing on either Google Groups or
> > gmane.editors.vim, and I'm wondering if the gateway from vim.org is
> > broken)
>
> The gateway is not broken, but every new poster's first post needs to
> be checked by a human list maintainer before it appears on the list.
> This is no hazing, it is a security measure against spam. Once a given
> author's post has been reviewed (which can take hours, and sometimes
> even days), further posts by the same author will appear in a matter
> of seconds or sometimes less, unless the list robot decides that one
> of them definitely looks like spam, in which case it will be submitted
> to the maintainers again.

It sounds like it might be sensible to just replace references to @vim.org
by the direct @googlegroups.com address on https://www.vim.org/maillist.php

> > I usually denote to ICCF about this time and just wanted to check the
> > status of this organisation following Bram's sad death.
> >
> > Should I use the PayPal link at https://iccf-holland.org/index.html or
> > is this still being worked on?

>
> ICCF Holland was not just a one-man organization resting on Bram's
> shoulders alone. All other people working for it have kept it up in
> Bram's spirit. I was present at Bram's funeral myself, and there was
> someone from ICCF there who pronounced an obituary, so it still
> exists. AFAIK, any bank accounts and PayPal links used by it during
> Bram's lifetime should still work identically after his death.
>
> About Vim being worked on: several people who used to propose code
> patches to Bram are still active, and Christian Brabandt is
> centralizing all these patches and publishing them on github and on
> Mercurial, the last one as of this writing dated 30 December 10:45, so
> Bram's death definitely did not put a halt to Vim's development.

My question about "is this still being worked on" was just about ICCF and prompted by reading

https://iccf-holland.org/index.html

and the September 2023 section

"Presently, we are arranging various practical issues to continue the charity"

Anyway thanks for your response and it seems likely using the PayPal
link is still fine and I'll donate.

Happy New Year to All.

Steve

--
Steve Mynott <steve.mynott@gmail.com>
rsa3072/629FBB91565E591955B5876A79CEFAA4450EBD50

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20231231205932.56jiwsxtp2jomk37%40risey.fivesnap.com.

Re: ICCF?

On Sun, Dec 31, 2023 at 5:41 PM Steve Mynott <steve.mynott@gmail.com> wrote:
>
> (Apologies if this is a double post. I sent to vim@vim.org 3 hours
> ago, and I don't see it appearing on either Google Groups or
> gmane.editors.vim, and I'm wondering if the gateway from vim.org is
> broken)

The gateway is not broken, but every new poster's first post needs to
be checked by a human list maintainer before it appears on the list.
This is no hazing, it is a security measure against spam. Once a given
author's post has been reviewed (which can take hours, and sometimes
even days), further posts by the same author will appear in a matter
of seconds or sometimes less, unless the list robot decides that one
of them definitely looks like spam, in which case it will be submitted
to the maintainers again.
>
> I usually denote to ICCF about this time and just wanted to check the
> status of this organisation following Bram's sad death.
>
> Should I use the PayPal link at https://iccf-holland.org/index.html or
> is this still being worked on?
>
> Or is there a similar organisation I should use currently?
>
> --
> Steve Mynott <steve.mynott@gmail.com>

ICCF Holland was not just a one-man organization resting on Bram's
shoulders alone. All other people working for it have kept it up in
Bram's spirit. I was present at Bram's funeral myself, and there was
someone from ICCF there who pronounced an obituary, so it still
exists. AFAIK, any bank accounts and PayPal links used by it during
Bram's lifetime should still work identically after his death.

About Vim being worked on: several people who used to propose code
patches to Bram are still active, and Christian Brabandt is
centralizing all these patches and publishing them on github and on
Mercurial, the last one as of this writing dated 30 December 10:45, so
Bram's death definitely did not put a halt to Vim's development.

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsLN7WeicpdFV%2BjF0Nk39a2C0ioNcxyHPO7a%3DW4fYyxAQ%40mail.gmail.com.

ICCF?

(Apologies if this is a double post. I sent to vim@vim.org 3 hours
ago, and I don't see it appearing on either Google Groups or
gmane.editors.vim, and I'm wondering if the gateway from vim.org is
broken)

I usually denote to ICCF about this time and just wanted to check the
status of this organisation following Bram's sad death.

Should I use the PayPal link at https://iccf-holland.org/index.html or
is this still being worked on?

Or is there a similar organisation I should use currently?

--
Steve Mynott <steve.mynott@gmail.com>
rsa3072/629FBB91565E591955B5876A79CEFAA4450EBD50

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuZA8QgkchCOPPUdDk4xmO7qw4LJuADe%3DLf%3DbJ5COGGXPu6sw%40mail.gmail.com.

Re: Building a Reactive Library from Scratch in Vim 9 Script

On 2023-12-30, Steve Litt <slitt@troubleshooters.com> wrote:
> I had a chuckle when you called Vimscript a "sane language". I'm more
> of a Lua or Python or C guy myself. But looking at your code, it looks
> like the Vim9 script language is a big improvement over that old viml
> stuff.

That was basically the sense of my post. I consider Vim 9 script the
last gift, and one of the most precious ones, Bram left us. My post
expresses my appreciation for the effort of the developers who are
building up on that gift: things are getting really really good! I was
pleasantly surprised that Vim did not crash or misbehave when fed with
some weird snippets such as that Russellian Subscribe() function :)

> Anyway, could you please summarize what you see as the benefits of
> reactive programming?

I can't really speak of the merits (or lack thereof) of reactive
programming. I have just started rewriting the style picker of my
Colortemplate plugin in Vim 9 script. There, the main problem is keeping
the attributes of a highlight group in sync with a bunch of UI widgets,
so it seemed to me like a good chance to explore some alternative
approaches.

From what I have seen so far, a reactive approach has some potential to
simplify my code both in terms of the amount needed and in terms of
correctness. The devil's in the details, of course, so maybe I will
eventually hit some wall and scratch everything. But I'm learning new
things and having fun, and that's what matters to me at the end of the
day.

Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/umruq4%247vp%241%40ciao.gmane.io.

ICCF?

I usually denote to ICCF about this time and just wanted to check the
status of this organisation following Bram's sad death.

Should I use the PayPal link at https://iccf-holland.org/index.html or
is this still being worked on?

Or is there a similar organisation I should use currently?

--
Steve Mynott <steve.mynott@gmail.com>
rsa3072/629FBB91565E591955B5876A79CEFAA4450EBD50

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuZA8TEDaT%2BxdjPfTZ9BfkbO8Of_jrv_D2-QcKpEwBm%3DfkG3Q%40mail.gmail.com.

Saturday, December 30, 2023

Re: Building a Reactive Library from Scratch in Vim 9 Script

Lifepillar said on Fri, 29 Dec 2023 17:58:32 -0000 (UTC)

>Today I was entertaining myself with articles about the "reactive
>programming" paradigm so popular nowadays, such as this:
>
> https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p
>
>As I could not understand that code, I decided to port it to a sane
>language:
>
> https://gist.github.com/lifepillar/d44e6ca33f0b1f66a0b403e133413699
>
>The task was pretty straightforward, I must say. The code still leaves
>much to be desired (among the rest because I've tried to deviate from
>the original as little as possible), but it works well.
>
>Enjoy!
>Life.

Thanks Life!

I had a chuckle when you called Vimscript a "sane language". I'm more
of a Lua or Python or C guy myself. But looking at your code, it looks
like the Vim9 script language is a big improvement over that old viml
stuff.

Anyway, could you please summarize what you see as the benefits of
reactive programming? As a guy who has used a lot of callback routines
(C, Perl and Python) in his life, I kinda sorta maybe understand at a
gut level, but I don't really fully understand the benefits in a way I
could explain or use them.

Thanks again for this ultra-cool post!

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20231230164120.23d0c5c0%40mydesk.domain.cxm.

Friday, December 29, 2023

Building a Reactive Library from Scratch in Vim 9 Script

Today I was entertaining myself with articles about the "reactive
programming" paradigm so popular nowadays, such as this:

https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p

As I could not understand that code, I decided to port it to a sane
language:

https://gist.github.com/lifepillar/d44e6ca33f0b1f66a0b403e133413699

The task was pretty straightforward, I must say. The code still leaves
much to be desired (among the rest because I've tried to deviate from
the original as little as possible), but it works well.

Enjoy!
Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/umn1c8%24u80%241%40ciao.gmane.io.

Re: vim9 exported functions not recognized by ctags

Hi,
perhaps someone :) should send a PR to
https://github.com/universal-ctags/ctags to add support for Vim9 Script?

Thanks,
Chris
--
An investment in knowledge always pays the best interest.
-- Benjamin Franklin

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZY6PWe4L0DsM064o%40256bit.org.

Re: vim9 exported functions not recognized by ctags

With exported vim9 function distinction :)

g:tagbar_type_vim in a json.
  "g:tagbar_type_vim": "{ 'kinds': [ 'L:classes', 'e:exported functions', 'f:functions and methods', 'v:variables:1:0', 'g:global variables', 'K:constants', 'c:commands:0:0', 'a:autocommand groups:1', 'm:maps:1:0', ], }",

vim.ctags
--kinddef-vim=e,vim9exportedfunc,Vim 9 global variables
--kinddef-vim=g,vim9global,Vim 9 global variables
--kinddef-vim=K,vim9const,Vim 9 constants
--kinddef-vim=L,vim9class,Vim 9 class
--kinddef-vim=I,vim9interface,Vim 9 interface
--regex-vim=/^export\s+def\s+([^(]+)/\1/e/
--regex-vim=/^def\s+([^(]+)/\1/f/
--regex-vim=/^\s*(g:\w+)\b/\1/g,vim9global/
--regex-vim=/^(export\s+)?(const|final)\s+(\w+)/\3/K,vim9const/
--regex-vim=/^\s*(export\s+)?(abstract\s+)?class\s+(\w+)/\3/L,vim9class/
--regex-vim=/^\s*(export\s+)?interface\s+(\w+)/\2/I,vim9interface/



On Friday 29 December 2023 at 10:09:22 am UTC+1 Nicolas wrote:
It works perfectly Life even if there is no disctinction between exported vim9 func and the other func. 
;)
Thank you I keep your
I wish you a happy holiday season
Nicolas

On Tuesday 19 December 2023 at 12:08:58 am UTC+1 Lifepillar wrote:
On 2023-12-16, Nicolas <niva...@gmail.com> wrote:
> this is mine .ctags.d
>
> --kinddef-vim=e,export,function,"Vim 9 exported functions"
> --kinddef-vim=f,function,"Vim 9 non-exported functions"
> --kinddef-vim=g,global,"Vim 9 global variables"
> --kinddef-vim=K,const,Vim 9 constants
> --regex-vim=/^\s*export\s+def\s+([^(:]+)/\1/e,export,def/
> --regex-vim=/^\s*def\s+([^(]+)/\1/f,function,def/
> --regex-vim=/^\s*(g:\w+)\b/\1/g,global/
> --regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
> --regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/
>
> with g:tagbar_type_vim = {'ctagstype': 'vim', 'kinds': ['e:export',
> 'g:global', 'K:const', 'f:function']}
>
> Hope this helps.
> nicolas

That should work, shouldn't it? Or what is your issue with it?

My current vim.ctags looks like this:

--kinddef-vim=g,vim9global,Vim 9 global variables
--kinddef-vim=K,vim9const,Vim 9 constants
--kinddef-vim=L,vim9class,Vim 9 class
--kinddef-vim=I,vim9interface,Vim 9 interface
--regex-vim=/^export\s+def\s+([^(]+)/\1/f/
--regex-vim=/^\s*(g:\w+)\b/\1/g,vim9global/
--regex-vim=/^(export\s+)?(const|final)\s+(\w+)/\3/K,vim9const/
--regex-vim=/^\s*(export\s+)?(abstract\s+)?class\s+(\w+)/\3/L,vim9class/
--regex-vim=/^\s*(export\s+)?interface\s+(\w+)/\2/I,vim9interface/

That works with Universal Ctags 6.0.0, as confirmed by:

uctags --list-kinds=Vim

which outputs:

a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
C constant definitions
g Vim 9 global variables
K Vim 9 constants
L Vim 9 class
I Vim 9 interface

In my `vimrc` I set the path to the executable:

g:tagbar_ctags_bin = '/opt/local/bin/uctags'

and for Vim tags:

g:tagbar_type_vim = {
'kinds': [
'L:classes',
'f:functions and methods',
'v:variables:1:0',
'g:global variables',
'K:constants',
'c:commands:0:0',
'a:autocommand groups:1',
'm:maps:1:0',
],
}

Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/19319839-9fd9-4310-8bac-5efa01a8c504n%40googlegroups.com.

Re: vim9 exported functions not recognized by ctags

It works perfectly Life even if there is no disctinction between exported vim9 func and the other func. 
;)
Thank you I keep your
I wish you a happy holiday season
Nicolas

On Tuesday 19 December 2023 at 12:08:58 am UTC+1 Lifepillar wrote:
On 2023-12-16, Nicolas <niva...@gmail.com> wrote:
> this is mine .ctags.d
>
> --kinddef-vim=e,export,function,"Vim 9 exported functions"
> --kinddef-vim=f,function,"Vim 9 non-exported functions"
> --kinddef-vim=g,global,"Vim 9 global variables"
> --kinddef-vim=K,const,Vim 9 constants
> --regex-vim=/^\s*export\s+def\s+([^(:]+)/\1/e,export,def/
> --regex-vim=/^\s*def\s+([^(]+)/\1/f,function,def/
> --regex-vim=/^\s*(g:\w+)\b/\1/g,global/
> --regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
> --regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/
>
> with g:tagbar_type_vim = {'ctagstype': 'vim', 'kinds': ['e:export',
> 'g:global', 'K:const', 'f:function']}
>
> Hope this helps.
> nicolas

That should work, shouldn't it? Or what is your issue with it?

My current vim.ctags looks like this:

--kinddef-vim=g,vim9global,Vim 9 global variables
--kinddef-vim=K,vim9const,Vim 9 constants
--kinddef-vim=L,vim9class,Vim 9 class
--kinddef-vim=I,vim9interface,Vim 9 interface
--regex-vim=/^export\s+def\s+([^(]+)/\1/f/
--regex-vim=/^\s*(g:\w+)\b/\1/g,vim9global/
--regex-vim=/^(export\s+)?(const|final)\s+(\w+)/\3/K,vim9const/
--regex-vim=/^\s*(export\s+)?(abstract\s+)?class\s+(\w+)/\3/L,vim9class/
--regex-vim=/^\s*(export\s+)?interface\s+(\w+)/\2/I,vim9interface/

That works with Universal Ctags 6.0.0, as confirmed by:

uctags --list-kinds=Vim

which outputs:

a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
C constant definitions
g Vim 9 global variables
K Vim 9 constants
L Vim 9 class
I Vim 9 interface

In my `vimrc` I set the path to the executable:

g:tagbar_ctags_bin = '/opt/local/bin/uctags'

and for Vim tags:

g:tagbar_type_vim = {
'kinds': [
'L:classes',
'f:functions and methods',
'v:variables:1:0',
'g:global variables',
'K:constants',
'c:commands:0:0',
'a:autocommand groups:1',
'm:maps:1:0',
],
}

Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/845edcac-6fd5-4d60-9494-2e4b1f911623n%40googlegroups.com.

Sunday, December 24, 2023

Re: Function to find all matches in a string?

Hi Tim,

On Sat, Dec 23, 2023 at 2:35 PM Tim Chase <vim@tim.thechases.com> wrote:
I was looking for something similar to Python's re.findall()/finditer()
function to answer a question on Reddit[1] but was surprised I
couldn't find anything in

  :help function-list

The general intent would be to take an input string and return a
List containing all the sub-strings matching a pattern like

  let matches=findall('amwenxipyuqz', '[aeiou]')

would set matches to

  ['aw', 'en', 'ip', 'uq']

I was able to cobble together a hack-job in this case, but I'd hoped
to be able to do something like

  :let a=[] | g/#\w\+/call extend(a, findall(getline('.'), @/))

Does such a function exist and I just missed it?


Currently no such function exists.  I have created PR https://github.com/vim/vim/pull/13766
to add support for the matchall() function.  Can you try that out?

Thanks,
Yegappan
 
Thanks!

-tim

[1]
https://www.reddit.com/r/vim/comments/18pcd84/the_vim_way/kenedxq/


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAW7x7mvoU%3DkxhBPbdPAnATW9vNgJ3ZXYD9YoJzv4jbwvdcw8g%40mail.gmail.com.

Re: Function to find all matches in a string?

On 2023-12-24 08:44, arocker@Vex.Net wrote:
>> I was looking for something similar to Python's re.findall()/finditer()
>> function to answer a question on Reddit[1] but was surprised I
>> couldn't find anything in
>
> Are you using Linux, MacOS ,or Windows?

In this case, it was FreeBSD (and I'm uncertain about the author
of the post on Reddit), and there are a bunch of shell-based or
programming-language-based solutions to the particular problem.
My question was more about the (non-)existence of an internal

func(str, regex) -> List of matches

type function.

-tim





--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZYhEEayK5QTSi7jo%40thechases.com.

Re: Function to find all matches in a string?

> I was looking for something similar to Python's re.findall()/finditer()
> function to answer a question on Reddit[1] but was surprised I
> couldn't find anything in
>

Are you using Linux, MacOS ,or Windows?

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7b1b4e3ee9139a4d18d929b42ad1c296.squirrel%40webmail.vybenetworks.com.

Saturday, December 23, 2023

Function to find all matches in a string?

I was looking for something similar to Python's re.findall()/finditer()
function to answer a question on Reddit[1] but was surprised I
couldn't find anything in

:help function-list

The general intent would be to take an input string and return a
List containing all the sub-strings matching a pattern like

let matches=findall('amwenxipyuqz', '[aeiou]')

would set matches to

['aw', 'en', 'ip', 'uq']

I was able to cobble together a hack-job in this case, but I'd hoped
to be able to do something like

:let a=[] | g/#\w\+/call extend(a, findall(getline('.'), @/))

Does such a function exist and I just missed it?

Thanks!

-tim

[1]
https://www.reddit.com/r/vim/comments/18pcd84/the_vim_way/kenedxq/





--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZYdgu8L-KK7n2ZbF%40thechases.com.

Monday, December 18, 2023

Re: vim9 exported functions not recognized by ctags

On 2023-12-16, Nicolas <nivaemail@gmail.com> wrote:
> this is mine .ctags.d
>
> --kinddef-vim=e,export,function,"Vim 9 exported functions"
> --kinddef-vim=f,function,"Vim 9 non-exported functions"
> --kinddef-vim=g,global,"Vim 9 global variables"
> --kinddef-vim=K,const,Vim 9 constants
> --regex-vim=/^\s*export\s+def\s+([^(:]+)/\1/e,export,def/
> --regex-vim=/^\s*def\s+([^(]+)/\1/f,function,def/
> --regex-vim=/^\s*(g:\w+)\b/\1/g,global/
> --regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
> --regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/
>
> with g:tagbar_type_vim = {'ctagstype': 'vim', 'kinds': ['e:export',
> 'g:global', 'K:const', 'f:function']}
>
> Hope this helps.
> nicolas

That should work, shouldn't it? Or what is your issue with it?

My current vim.ctags looks like this:

--kinddef-vim=g,vim9global,Vim 9 global variables
--kinddef-vim=K,vim9const,Vim 9 constants
--kinddef-vim=L,vim9class,Vim 9 class
--kinddef-vim=I,vim9interface,Vim 9 interface
--regex-vim=/^export\s+def\s+([^(]+)/\1/f/
--regex-vim=/^\s*(g:\w+)\b/\1/g,vim9global/
--regex-vim=/^(export\s+)?(const|final)\s+(\w+)/\3/K,vim9const/
--regex-vim=/^\s*(export\s+)?(abstract\s+)?class\s+(\w+)/\3/L,vim9class/
--regex-vim=/^\s*(export\s+)?interface\s+(\w+)/\2/I,vim9interface/

That works with Universal Ctags 6.0.0, as confirmed by:

uctags --list-kinds=Vim

which outputs:

a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
C constant definitions
g Vim 9 global variables
K Vim 9 constants
L Vim 9 class
I Vim 9 interface

In my `vimrc` I set the path to the executable:

g:tagbar_ctags_bin = '/opt/local/bin/uctags'

and for Vim tags:

g:tagbar_type_vim = {
'kinds': [
'L:classes',
'f:functions and methods',
'v:variables:1:0',
'g:global variables',
'K:constants',
'c:commands:0:0',
'a:autocommand groups:1',
'm:maps:1:0',
],
}

Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ulqjdr%2416cs%241%40ciao.gmane.io.

Re: vimgrep on files in 'path'

Hi!

You could use the arglist for this.
I'm not sure how to set it from a path but I think you'll find a way to do it.

Once your arglist is set, use `vimgrep /pattern/ ##` to grep the files in the arglist.

Regards,
Tris'
-------- Original Message --------
On Dec 18, 2023, 20:27, Arun < findanarun@gmail.com> wrote:

Hi there,

I wonder if there is any "grep" like counterpart for the ":find" command in vim. Today, ":find" helps one find any file in the 'path'. It would be nice to perform a search for a pattern in the files reachable via 'path'. I could then invoke, say,
    :findgrep /mypattern/ **/*def.h

..to grep for "mypattern" in files reachable via 'path' that ends in "def.h".

I tried to script it by passing the filenames to ":vimgrep" using:
    :exe 'vim/mypattern/'. join(getcompletion('**/*def.h', 'file_in_path'), " ")

..but getcompletion() sometimes does not give me the full path leading to errors.

Regards,
-Arun

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/uxKxGqpo5E17_GBkoqirhH1l6D1CN_ogXgcylK2e69v4uB3M4WV2PA3gElXZDwoQXerzPCqmjX8WU26N2gzAOh2cs4_XufOn35VW9UDtKdQ%3D%40protonmail.com.

vimgrep on files in 'path'

Hi there,

I wonder if there is any "grep" like counterpart for the ":find" command in vim. Today, ":find" helps one find any file in the 'path'. It would be nice to perform a search for a pattern in the files reachable via 'path'. I could then invoke, say,
    :findgrep /mypattern/ **/*def.h

..to grep for "mypattern" in files reachable via 'path' that ends in "def.h".

I tried to script it by passing the filenames to ":vimgrep" using:
    :exe 'vim/mypattern/'. join(getcompletion('**/*def.h', 'file_in_path'), " ")

..but getcompletion() sometimes does not give me the full path leading to errors.

Regards,
-Arun

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFTzLR%3D-OWnBF-MXaB%2B451H8%3DJJ6ojsLJVmgACZMOg6jw%40mail.gmail.com.

Saturday, December 16, 2023

Re: vim9 exported functions not recognized by ctags

this is mine .ctags.d

--kinddef-vim=e,export,function,"Vim 9 exported functions"
--kinddef-vim=f,function,"Vim 9 non-exported functions"
--kinddef-vim=g,global,"Vim 9 global variables"
--kinddef-vim=K,const,Vim 9 constants
--regex-vim=/^\s*export\s+def\s+([^(:]+)/\1/e,export,def/
--regex-vim=/^\s*def\s+([^(]+)/\1/f,function,def/
--regex-vim=/^\s*(g:\w+)\b/\1/g,global/
--regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
--regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/

with g:tagbar_type_vim = {'ctagstype': 'vim', 'kinds': ['e:export', 'g:global', 'K:const', 'f:function']}

Hope this helps.
nicolas

Le sam. 16 déc. 2023 à 13:36, Nicolas <nivaemail@gmail.com> a écrit :
Hi Life,

How to get exported and not exported def vim9 functions please according to g:tagbar_type_vim = { 'ctagstype': 'vim', 'kinds': ['e:export'] }?

Thank you
Nicolas
Le mercredi 10 août 2022 à 22:20:52 UTC+2, Lifepillar a écrit :
On 2022-08-10, N V <niva...@gmail.com> wrote:
> Hi,
>
> Exported functions in New vim9 are not found by exubérant ctags, universal
> ctags and not displayed by tagbar plugin
> https://github.com/preservim/tagbar
>
> Is there a work around.

I have the same problem. I think that this will be eventually solved
upstream, but in the meantime the following works for me with Universal
Ctags (I haven't had time to refine this, so what follows is just
a sketch):

1. Create ~/.ctags.d/vim.ctags with the following content:

--kinddef-vim=e,export,exported function
--regex-vim=/^[ \t]*export[ \t]+def[ \t]+([^(]+)/\1/e,export/

2. In your .vimrc, or in your after/ftplugin/vim.vim file, inform Tagbar
about the new entity:

g:tagbar_type_vim = { 'ctagstype': 'vim', 'kinds': ['e:export'] }

Now, Tagbar should display (only) exported functions. Refer to Tagbar
documentation to learn how to *extend* the already recognized entities
by adding exported functions.

Hope this helps,
Life.


--
--
You received this message from the "vim_use" 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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/hp4KeIsDlFU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/260b74f5-7d2e-4446-b87e-a671c493d84an%40googlegroups.com.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAOKxv4E7ZECZO18xGQ0Yr2GweRnuaJ1aZoObZbpcYKypySKF4w%40mail.gmail.com.

Re: vim9 exported functions not recognized by ctags

Hi Life,

How to get exported and not exported def vim9 functions please according to g:tagbar_type_vim = { 'ctagstype': 'vim', 'kinds': ['e:export'] }?

Thank you
Nicolas
Le mercredi 10 août 2022 à 22:20:52 UTC+2, Lifepillar a écrit :
On 2022-08-10, N V <niva...@gmail.com> wrote:
> Hi,
>
> Exported functions in New vim9 are not found by exubérant ctags, universal
> ctags and not displayed by tagbar plugin
> https://github.com/preservim/tagbar
>
> Is there a work around.

I have the same problem. I think that this will be eventually solved
upstream, but in the meantime the following works for me with Universal
Ctags (I haven't had time to refine this, so what follows is just
a sketch):

1. Create ~/.ctags.d/vim.ctags with the following content:

--kinddef-vim=e,export,exported function
--regex-vim=/^[ \t]*export[ \t]+def[ \t]+([^(]+)/\1/e,export/

2. In your .vimrc, or in your after/ftplugin/vim.vim file, inform Tagbar
about the new entity:

g:tagbar_type_vim = { 'ctagstype': 'vim', 'kinds': ['e:export'] }

Now, Tagbar should display (only) exported functions. Refer to Tagbar
documentation to learn how to *extend* the already recognized entities
by adding exported functions.

Hope this helps,
Life.


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/260b74f5-7d2e-4446-b87e-a671c493d84an%40googlegroups.com.

Thursday, December 14, 2023

Re: Out_cb callback handler in vim9

Thank you Life it works perfectly ;)
Nicolas

Le dimanche 10 décembre 2023 à 20:55:57 UTC+1, Lifepillar a écrit :
On 2023-12-09, Nicolas <niva...@gmail.com> wrote:
> Hi all,
>
> According to Bram example in the job's help now,
> Is it possible to pass additional parameters to job's handlers callback in
> vim9script ?

Yes. See, for instance, $VIMRUNTIME/autoload/typeset.vim, in particular
the Callbacks section and the Typeset() function.

> This minimal example with additional params:
> def Compress_OnExit(job_id: job, exit_status: number, foo: string): void
> echom 'Job OnExit ' .. job_id->string() .. ' exited with status ' ..
> exit_status
> # Compress_CopyToDrive('PATRIOT')
> enddef
> var job = job_start(cmd, { 'exit_cb': function('Compress_OnExit',
> ['foo']) } )

That should be:

var job = job_start(['ls'], {
exit_cb: (j, e) => Compress_OnExit(j, e, 'foo')
})

Hope this helps,
Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/4cf67b5b-f6d8-4d85-8d59-84f67168a9b4n%40googlegroups.com.

Sunday, December 10, 2023

Re: Out_cb callback handler in vim9

On 2023-12-09, Nicolas <nivaemail@gmail.com> wrote:
> Hi all,
>
> According to Bram example in the job's help now,
> Is it possible to pass additional parameters to job's handlers callback in
> vim9script ?

Yes. See, for instance, $VIMRUNTIME/autoload/typeset.vim, in particular
the Callbacks section and the Typeset() function.

> This minimal example with additional params:
> def Compress_OnExit(job_id: job, exit_status: number, foo: string): void
> echom 'Job OnExit ' .. job_id->string() .. ' exited with status ' ..
> exit_status
> # Compress_CopyToDrive('PATRIOT')
> enddef
> var job = job_start(cmd, { 'exit_cb': function('Compress_OnExit',
> ['foo']) } )

That should be:

var job = job_start(['ls'], {
exit_cb: (j, e) => Compress_OnExit(j, e, 'foo')
})

Hope this helps,
Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ul553q%24puu%241%40ciao.gmane.io.

Re: Using Vim's logo for a tabletop game

On Sa, 09 Dez 2023, try catch it wrote:

> Dear Vim community,
>
> We hope this message finds you well. We are Clara Jiménez Recio and Celia Velasco Martínez and we are excitedly embarking on a personal project to create a tabletop game with a focus on the dev community.
>
> The mechanics of our game, tentatively titled "try {} catch (it)", involve working with more than 50 logos of different programming tools. Multiple logos will appear on each card, and the gameplay is centered around identifying the
> matching logo in each pair of cards.
>
> We are wondering whether it would be okay to include Vim's logo within the game. Of course, any required disclaimer would be included.

I'd like to see the game first. Unless it's some un-ethical usage of the
game play (or of the other logos used), that should be fine however.

It would be great, if you could link to the Vim.org homepage.

Thanks,
Christian
--
Sell by date stamped on bottom.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZXXK5iOEzoTEZQEO%40256bit.org.

Saturday, December 9, 2023

Using Vim's logo for a tabletop game

Dear Vim community,

We hope this message finds you well. We are Clara Jiménez Recio and Celia Velasco Martínez and we are excitedly embarking on a personal project to create a tabletop game with a focus on the dev community.

The mechanics of our game, tentatively titled "try {} catch (it)", involve working with more than 50 logos of different programming tools. Multiple logos will appear on each card, and the gameplay is centered around identifying the matching logo in each pair of cards.

We are wondering whether it would be okay to include Vim's logo within the game. Of course, any required disclaimer would be included.

Many thanks,
Clara and Celia

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/f5fc5b1e-c8ff-4f10-851e-c1209cf04e9en%40googlegroups.com.

Re: Out_cb callback handler in vim9

Hi all,

According to Bram example in the job's help now, 
Is it possible to pass additional parameters to job's handlers callback in vim9script ?
Thank you
Nicolas

This minimalist example WORKING as Bram said:
def Compress_OnExit(job_id: job, exit_status: number): void
    echom 'Job OnExit ' .. job_id->string() .. ' exited with status ' .. exit_status
enddef
var job = job_start(cmd, { 'exit_cb': Compress_OnExit}) 

This minimal example with additional params: 
def Compress_OnExit(job_id: job, exit_status: number, foo: string): void
    echom 'Job OnExit ' .. job_id->string() .. ' exited with status ' .. exit_status
    # Compress_CopyToDrive('PATRIOT')
enddef
var job = job_start(cmd, { 'exit_cb': function('Compress_OnExit', ['foo']) } )



Le dimanche 27 février 2022 à 14:25:43 UTC+1, Bram Moolenaar a écrit :

> In §9 of channel help is mentionned the legacy vimscript out_cb handler.
>
>
> " let job = job_start(command, {"out_cb": "MyHandler"})
> The function will be called with the channel and a message. You would define
> it like this: >
> func MyHandler(channel, msg)
> "
>
>
> I tried this def OutCb function but got the following message error :
>
> " def OutCb(l: list<any>)
> # echomsg 'OutCb' .. string(l)
> # eval [][0]
> enddef
>
> def ExitCb(l: list<any>)
> # echomsg 'ExitCb' .. string(l)
> # sleep 1m
> # source += l
> # echomsg 'Exiting ' .. string(l) .. ' ' .. string(@z)
> enddef
>
> jobid = job_start(zip_cmd, { out_cb: OutCb, exit_cb: ExitCb, mode:
> 'raw', timeout: 1200000 } ) "
>
> Error message:
> " This is a valid directory .
> Jobid: process 14328 run
> Press ENTER or type command to continue
> E118: Too many arguments for function: <lambda>4 "
>
>
> How to port and deal with this in vim9 script that seems to have only one
> argue ?

In Vim9 script the type of the arguments is checked. That helps you
writing correct functions, and once written it is easier to read back.
It does require a bit of extra text.

Here is an exmple that will help you:

vim9script

# Create a channel log so we can see what happens.
ch_logfile('logfile', 'w')

var shell_job: job

# Function handling a line of text that has been typed.
def TextEntered(text: string)
# Send the text to a shell with Enter appended.
ch_sendraw(shell_job, text .. "\n")
enddef

# Function handling output from the shell: Add it above the prompt.
def GotOutput(channel: channel, msg: string)
append(line("$") - 1, "- " .. msg)
enddef

# Function handling the shell exits: close the window.
def JobExit(job: job, status: number)
quit!
enddef

# Start a shell in the background.
shell_job = job_start(["/bin/sh"], {
out_cb: GotOutput,
err_cb: GotOutput,
exit_cb: JobExit,
})

new
set buftype=prompt
var buf = bufnr('')
prompt_setcallback(buf, TextEntered)
prompt_setprompt(buf, "shell command: ")

# start accepting shell commands
startinsert


--
hundred-and-one symptoms of being an internet addict:
115. You are late picking up your kid from school and try to explain
to the teacher you were stuck in Web traffic.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b08ff15b-4603-4448-877d-2fb31b658103n%40googlegroups.com.

Wednesday, December 6, 2023

Re: Importing values from vim to python in vim9

You are right. The variable names in the above example should be without quotes MyFunction(variable1, variable2) . 
In my functions, they are without quotes.

On Wednesday, December 6, 2023 at 1:14:04 AM UTC+1 Salman Halim wrote:
I might be nitpicking, but why are the function parameters in the function definition in quotes?

Salman

On Tue, Dec 5, 2023, 17:14 Christian Brabandt <cbl...@256bit.org> wrote:

On Di, 05 Dez 2023, rameo wrote:

> I installed vim 9 but still have multiple functions written in old vimscript.
>
> I've read that functions written in old vimscript still work.
>
> However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works
>
> I don't always get the right values imported.
>
> Example :
>
> :call MyFunction("12", "14") 
>
> function! MyFunction("variable1, variable2") 
> python3 << endpython 
> variable1 = vim.eval("a:variable1") 
> variable2 = vim.eval("a:variable2") 
> print(variable1 + " " + variable2) 
> endpython 
>
> endfunction
>
> What's wrong in above code?
>
> Or better... why doesn't it work anymore in vim9?

Do you get an error message? Which one? If this doesn't work anymore,
when did it stop working?

Thanks,
Christian
--
Driver does not carry cash.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZW%2Bgsu3Q23sAczgm%40256bit.org.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e4c19d3a-eb3e-472b-9360-cdd4440c02f5n%40googlegroups.com.

Tuesday, December 5, 2023

Re: Importing values from vim to python in vim9

I might be nitpicking, but why are the function parameters in the function definition in quotes?

Salman

On Tue, Dec 5, 2023, 17:14 Christian Brabandt <cblists@256bit.org> wrote:

On Di, 05 Dez 2023, rameo wrote:

> I installed vim 9 but still have multiple functions written in old vimscript.
>
> I've read that functions written in old vimscript still work.
>
> However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works
>
> I don't always get the right values imported.
>
> Example :
>
> :call MyFunction("12", "14") 
>
> function! MyFunction("variable1, variable2") 
> python3 << endpython 
> variable1 = vim.eval("a:variable1") 
> variable2 = vim.eval("a:variable2") 
> print(variable1 + " " + variable2) 
> endpython 
>
> endfunction
>
> What's wrong in above code?
>
> Or better... why doesn't it work anymore in vim9?

Do you get an error message? Which one? If this doesn't work anymore,
when did it stop working?

Thanks,
Christian
--
Driver does not carry cash.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZW%2Bgsu3Q23sAczgm%40256bit.org.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEf9AMB48j-jsKAca_CW5Y_jTh4faK2GQFXxQjFbLR10xQ%40mail.gmail.com.

Re: Importing values from vim to python in vim9

No message. 
I noticed that the values are no longer correct. I am using the same function more and the values are not refreshed. Old values are kept.
I can't remember exactly when it stopped working. I noticed it today.

I just tested with this:
variable1 = str(vim.bindeval("a:variable1"))
variable2 = str(vim.bindeval("a:variable2"))


This works.

But now it's binary isn't it (b'value')? How do I get it as text again?
Isn't there a better solution?

Thanks,
Rameo

On Tuesday, December 5, 2023 at 11:14:21 PM UTC+1 Christian Brabandt wrote:

On Di, 05 Dez 2023, rameo wrote:

> I installed vim 9 but still have multiple functions written in old vimscript.
>
> I've read that functions written in old vimscript still work.
>
> However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works
>
> I don't always get the right values imported.
>
> Example :
>
> :call MyFunction("12", "14") 
>
> function! MyFunction("variable1, variable2") 
> python3 << endpython 
> variable1 = vim.eval("a:variable1") 
> variable2 = vim.eval("a:variable2") 
> print(variable1 + " " + variable2) 
> endpython 
>
> endfunction
>
> What's wrong in above code?
>
> Or better... why doesn't it work anymore in vim9?

Do you get an error message? Which one? If this doesn't work anymore,
when did it stop working?

Thanks,
Christian
--
Driver does not carry cash.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/c7057a99-f171-459a-a834-58f7ac397e1bn%40googlegroups.com.

Re: Importing values from vim to python in vim9

On Di, 05 Dez 2023, rameo wrote:

> I installed vim 9 but still have multiple functions written in old vimscript.
>
> I've read that functions written in old vimscript still work.
>
> However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works
>
> I don't always get the right values imported.
>
> Example :
>
> :call MyFunction("12", "14") 
>
> function! MyFunction("variable1, variable2") 
> python3 << endpython 
> variable1 = vim.eval("a:variable1") 
> variable2 = vim.eval("a:variable2") 
> print(variable1 + " " + variable2) 
> endpython 
>
> endfunction
>
> What's wrong in above code?
>
> Or better... why doesn't it work anymore in vim9?

Do you get an error message? Which one? If this doesn't work anymore,
when did it stop working?

Thanks,
Christian
--
Driver does not carry cash.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZW%2Bgsu3Q23sAczgm%40256bit.org.

Importing values from vim to python in vim9

I installed vim 9 but still have multiple functions written in old vimscript.

I've read that functions written in old vimscript still work.

However I noticed that importing variables into Python `vim.eval("a:myvariable")` no longer works

I don't always get the right values imported.

Example :

:call MyFunction("12", "14") 

function! MyFunction("variable1, variable2") 
python3 << endpython 
variable1 = vim.eval("a:variable1") 
variable2 = vim.eval("a:variable2") 
print(variable1 + " " + variable2) 
endpython 

endfunction

What's wrong in above code?

Or better... why doesn't it work anymore in vim9?

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/cce40585-46a4-4967-8f09-2aaf8398d117n%40googlegroups.com.