Tuesday, October 8, 2024

Re: (Bug ?) Sometimes { in insert mode triggers normal mode

Hi Tim,

I realized that the issue was due to a wrong keyboard layout.

S.


On Tue, 8 Oct 2024, 2:30 pm Tim Chase, <vim@tim.thechases.com> wrote:
On 2024-10-07 17:11, simo zz wrote:
> I have noticed (on Linux) that pressing `'{' in insert mode, vim/gvim
> sometimes triggers the normal mode: I mean vim goes from insert to
> normal mode.
>
> I do not have any mapping related to '{' in insert mode neither in
> normal mode.

This sounds suspiciously like somehow control+[ is getting pressed
(which sends the same key-code as escape).  Is there any chance you're
holding down control rather than shift when this happens?  If you
log keystrokes at the OS level (such as with one of those used in
screen-casts), does it report control+[ instead of shift+[→escape?
It could also be a keyboard issue where a faulty contact is sending
control-modifier rather than a shift-modifier, so if you can try it with
a second keyboard (if you have a spare USB keyboard or can borrow one
for testing), it might help narrow things down.

-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/ZwUl2gh8P7TxL59s%40thechases.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/CAFvb%3DpZ8y3i8ZiOGmuU0-3N8v5_y%3DTy1VC2EP3B74Ni_6cJTjw%40mail.gmail.com.

Re: (Bug ?) Sometimes { in insert mode triggers normal mode

On 2024-10-07 17:11, simo zz wrote:
> I have noticed (on Linux) that pressing `'{' in insert mode, vim/gvim
> sometimes triggers the normal mode: I mean vim goes from insert to
> normal mode.
>
> I do not have any mapping related to '{' in insert mode neither in
> normal mode.

This sounds suspiciously like somehow control+[ is getting pressed
(which sends the same key-code as escape). Is there any chance you're
holding down control rather than shift when this happens? If you
log keystrokes at the OS level (such as with one of those used in
screen-casts), does it report control+[ instead of shift+[→escape?
It could also be a keyboard issue where a faulty contact is sending
control-modifier rather than a shift-modifier, so if you can try it with
a second keyboard (if you have a spare USB keyboard or can borrow one
for testing), it might help narrow things down.

-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/ZwUl2gh8P7TxL59s%40thechases.com.

Monday, October 7, 2024

(Bug ?) Sometimes { in insert mode triggers normal mode

Hello,

I have noticed (on Linux) that pressing `'{' in insert mode, vim/gvim sometimes triggers the normal mode: I mean vim goes from insert to normal mode.

I do not have any mapping related to '{' in insert mode neither in normal mode.

The current version testes is v9.1.0764, but I noticed the problem also with v9.1.0748.รง

Cheers,

Simon

--
--
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/CAFvb%3DpZJG-eYc7-hcRRbX_HdRmKW07A98008yLrGANowMZFvJQ%40mail.gmail.com.

Thursday, October 3, 2024

Re: Finding all words

Very good idea. Thanks again.

Salman

On Thu, Oct 3, 2024, 12:09 Tim Chase <vim@tim.thechases.com> wrote:
On 2024-10-03 11:58, Salman Halim wrote:
> >     /.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

> something that does the combination thing I was suggesting and time the two
> approaches, but with more than just two words: /quick.*brown\|brown.*quick/
> vs. /.\{-}quick\&.\{-}brown}/

At the cost of some redundancy, you might be able to speed it up a
little bit by requiring that it start with at least one of the words
like

  /\%(\<\%(quick\|brown\|lazy\|jumps\)\>\)\@=\%(.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps\)/

so it won't start looking for the other terms until it's found at
least one of them, cutting out a lot of non-starter cases.

-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/Zv7Bt-O8KlBggCtX%40thechases.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/CANuxnEeptRdJnWHNSPa2Kprm1By3VBf-_U2g5v%2BCq%2BK-g3Rr1A%40mail.gmail.com.

Re: Finding all words

On 2024-10-03 11:58, Salman Halim wrote:
> > /.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

> something that does the combination thing I was suggesting and time the two
> approaches, but with more than just two words: /quick.*brown\|brown.*quick/
> vs. /.\{-}quick\&.\{-}brown}/

At the cost of some redundancy, you might be able to speed it up a
little bit by requiring that it start with at least one of the words
like

/\%(\<\%(quick\|brown\|lazy\|jumps\)\>\)\@=\%(.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps\)/

so it won't start looking for the other terms until it's found at
least one of them, cutting out a lot of non-starter cases.

-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/Zv7Bt-O8KlBggCtX%40thechases.com.

Re: Finding all words



On Thu, Oct 3, 2024 at 10:18 AM Tim Chase <vim@tim.thechases.com> wrote:
On 2024-10-03 15:09, Mikhail Velikikh wrote:
> > Is there a way to compose a regular expression in Vim that will find all
> > the words I want, irrespective of the order in which they occur?
>
> I would use something like this:
> \v<(quick|brown|lazy|jumps)>

That finds *any* of the words, not *all* of the words as the OP requested.

While the implementation can often end up slow if you have a large
text or lots of find-them-all terms, you (OP) can use

   :help /\&

to join the conditions like

    /.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

-tim

Thank you; that's exactly what I was looking for. It does slow down, though, as you said it might, once I add more words to it. I might write something that does the combination thing I was suggesting and time the two approaches, but with more than just two words: /quick.*brown\|brown.*quick/ vs. /.\{-}quick\&.\{-}brown}/ 

Best regards,

Salman

--
--
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/CANuxnEcXmK25RhOrXZ9eA0PnogP76DKMr9gsBuD4sgm%2Bw6q_5Q%40mail.gmail.com.

Re: Finding all words

On 2024-10-03 15:09, Mikhail Velikikh wrote:
> > Is there a way to compose a regular expression in Vim that will find all
> > the words I want, irrespective of the order in which they occur?
>
> I would use something like this:
> \v<(quick|brown|lazy|jumps)>

That finds *any* of the words, not *all* of the words as the OP requested.

While the implementation can often end up slow if you have a large
text or lots of find-them-all terms, you (OP) can use

:help /\&

to join the conditions like

/.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

-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/Zv6nnfKqWolaBkMm%40thechases.com.