Wednesday, December 18, 2024

Re: Search anomaly?

On Wed, Dec 18, 2024 at 12:06 PM Christian Brabandt <cblists@256bit.org> wrote:

On Wed, 18 Dec 2024, Arun E wrote:

> With a buffer having just..
>
> aaa
> bbb
> aaa
>
> ..and with the cursor on the first 'a' on the first line, when you search for 'aa', the hit on the first line -- the 'aa' starting at column 2 -- is not found, rather the cursor lands on the 3rd line. Is this a documented behavior? It is
> the same behaviour in vim 8 and 9. I have not tried other versions.
>
> Playing around on it a bit more, I kinda understand why. Vim seems to try to match the "aa" in the current position, and avoid the 'a' in column 2 for subsequent matches. A zero width pattern seems to hit all occurrences (\(aa\)\@=).
>

Yes, I see the same going back to vim74. Interestingly traditional ex-vi
behaves the same, while nvi jumps by each single "a" forward (which is
also confusing: on a line like this:
aaaaaa
and then searching for aa and hitting n
the cursor will move only by a single a forward, while I would expect it
to move by 2 "a")

Ah, I see, thanks for the results on different editors.

Though out of the norm, I like the nvi behavior. Glad to know that vim
also could mimic that.
 

I checked the POSIX specs, but it doesn't mention anything about it (or
I did not find it).

> Anyway, the current behavior is very confusing, perhaps should be
> documented if not done already.

It's hard to find and hard to understand, but :h cpo-c let's you
configure this.

I had a hunch (or maybe I read sometime ago) that it would be in cpo, but thanks for pointing
out exactly where it is. Though I want that behavior, I will just use that on a need
basis. I am sure it is going to break many plugins if I turn it on unconditionally.

Thanks again Christian!

Regards,
-Arun


Best,
Christian
--
"For the most part, Democrats don't question the Republican's right to govern
when they win elections"

Heck, Democrats don't question the Republican's right to govern even when
Democrats win elections.
    -- Moopheus, on scienceblogs.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 visit https://groups.google.com/d/msgid/vim_use/Z2MrRq/NT2kNOoKA%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 visit https://groups.google.com/d/msgid/vim_use/CAJUkyiH8dUP1SNPo5GzHb2c878k6rZ3KHZo_bRa%3DWLHdqmPixg%40mail.gmail.com.

Re: Search anomaly?

Don't know if this helps but if you have 
aaaa

Vim will find the first set of aa's and go to the second set of aa's as if it was 'aa aa'.  Assuming because it already included the 2nd a in the first set of aa's.

On Wed, Dec 18, 2024 at 2:22 PM Arun E <aemails@gmail.com> wrote:
Hi,

With a buffer having just..

aaa
bbb
aaa

..and with the cursor on the first 'a' on the first line, when you search for 'aa', the hit on the first line -- the 'aa' starting at column 2 -- is not found, rather the cursor lands on the 3rd line. Is this a documented behavior? It is the same behaviour in vim 8 and 9. I have not tried other versions.

Playing around on it a bit more, I kinda understand why. Vim seems to try to match the "aa" in the current position, and avoid the 'a' in column 2 for subsequent matches. A zero width pattern seems to hit all occurrences (\(aa\)\@=).

Anyway, the current behavior is very confusing, perhaps should be documented if not done already.

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 visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFUkaBcKLXDh-CBNSZGYqATaUOMYz2tOqAQuOzD4uNFRA%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 visit https://groups.google.com/d/msgid/vim_use/CANrhvDEiFh%2BSdRFS9XhyXBaa7bQFnwW7BUsJYTKgHZ1NQGNREQ%40mail.gmail.com.

Re: Search anomaly?

On Wed, 18 Dec 2024, Arun E wrote:

> With a buffer having just..
>
> aaa
> bbb
> aaa
>
> ..and with the cursor on the first 'a' on the first line, when you search for 'aa', the hit on the first line -- the 'aa' starting at column 2 -- is not found, rather the cursor lands on the 3rd line. Is this a documented behavior? It is
> the same behaviour in vim 8 and 9. I have not tried other versions.
>
> Playing around on it a bit more, I kinda understand why. Vim seems to try to match the "aa" in the current position, and avoid the 'a' in column 2 for subsequent matches. A zero width pattern seems to hit all occurrences (\(aa\)\@=).
>

Yes, I see the same going back to vim74. Interestingly traditional ex-vi
behaves the same, while nvi jumps by each single "a" forward (which is
also confusing: on a line like this:
aaaaaa
and then searching for aa and hitting n
the cursor will move only by a single a forward, while I would expect it
to move by 2 "a")

I checked the POSIX specs, but it doesn't mention anything about it (or
I did not find it).

> Anyway, the current behavior is very confusing, perhaps should be
> documented if not done already.

It's hard to find and hard to understand, but :h cpo-c let's you
configure this.

Best,
Christian
--
"For the most part, Democrats don't question the Republican's right to govern
when they win elections"

Heck, Democrats don't question the Republican's right to govern even when
Democrats win elections.
-- Moopheus, on scienceblogs.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 visit https://groups.google.com/d/msgid/vim_use/Z2MrRq/NT2kNOoKA%40256bit.org.

Search anomaly?

Hi,

With a buffer having just..

aaa
bbb
aaa

..and with the cursor on the first 'a' on the first line, when you search for 'aa', the hit on the first line -- the 'aa' starting at column 2 -- is not found, rather the cursor lands on the 3rd line. Is this a documented behavior? It is the same behaviour in vim 8 and 9. I have not tried other versions.

Playing around on it a bit more, I kinda understand why. Vim seems to try to match the "aa" in the current position, and avoid the 'a' in column 2 for subsequent matches. A zero width pattern seems to hit all occurrences (\(aa\)\@=).

Anyway, the current behavior is very confusing, perhaps should be documented if not done already.

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 visit https://groups.google.com/d/msgid/vim_use/CAJUkyiFUkaBcKLXDh-CBNSZGYqATaUOMYz2tOqAQuOzD4uNFRA%40mail.gmail.com.

Monday, December 16, 2024

Re: What would be an easy way for me to learn Vim9script?

Good afternoon,

A free Vim9script tutorial is apparently a lacuna to be filled;
there are some assorted observations such as [0] and [1], but
something more systematic I could only find [2] which only shows 
the source code which is mostly wrong as it declares vim9script but uses 
legacy vimscript if one looks for example at 05_dictionaries.vim. 
Ideal to get converts up to speed would be the readership of this mailing list
contributing to this pull request [3] for LearnXinYMinutes. 

   Enno

[3] https://github.com/adambard/learnxinyminutes-docs/pull/5215

Le samedi 14 décembre 2024 à 23:21:10 UTC+1, Steve Litt a écrit :
Hi all,

What would be an easy way for me to learn to use Vim9script? I have a
lot of things to do so this would need to be relatively quick.

Thanks,

SteveT

Steve Litt
http://444domains.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 visit https://groups.google.com/d/msgid/vim_use/c2de4d8b-7f20-4ce8-8a72-7dc8ee001e7an%40googlegroups.com.

Saturday, December 14, 2024

What would be an easy way for me to learn Vim9script?

Hi all,

What would be an easy way for me to learn to use Vim9script? I have a
lot of things to do so this would need to be relatively quick.

Thanks,

SteveT

Steve Litt
http://444domains.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 visit https://groups.google.com/d/msgid/vim_use/20241214172058.101d7b39%40mydesk.domain.cxm.

Re: An std-lib for Vim9script

Igbanam Ogbuluijah said on Thu, 12 Dec 2024 09:04:14 +0000

>Hi everyone,
>
>What do we think about getting a standard library (std-lib) of sorts
>for vim9script?

In every language, I'm a big fan of *well curated, language community
supported* standard libraries. If it's well thought out, easy to use,
easy to document, and mostly bug free, I like the idea.

>Would Vim9script be looking to expand these into a formal std-lib?
>Also, if I wanted to contribute a library to Vim9script, where in the
>codebase should I be looking into?

It's *very* important that any standard library be well curated. This
means not everything goes in the standard library, just stuff that
works, works well, makes programming easier, and is relatively bug
free. Therefore I think the standard library should most likely be a
subset of the library additions.

In summary, if you make it easier for me to learn and use Vim9script,
I'm a huge fan. I might even rewrite VimOutliner in Vim9script, because
truth be told, the old Vimscript was, in my opinion, horrible.

SteveT

Steve Litt

http://444domains.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 visit https://groups.google.com/d/msgid/vim_use/20241214171945.7559e481%40mydesk.domain.cxm.