Friday, April 30, 2021

Error starting :Termdebug

Hi,
I get this error running vim 8.2 when starting :Termdebug:

Error detected while processing function <SNR>2_StartDebug[2]..<SNR>2_StartDebug_internal[50]..<SNR>2_StartDebug_term:
line   97:
Cannot check if your gdb works, continuing anyway
Press ENTER or type command to continue

After a few seconds GDB starts anyway. Is there a way I can disable this error message?

Thanks,
Uri

--
--
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/CAMJd5ARYeSYcaj%3DVQ%3DTgoFJKjUJUkJ5F3G4%2B4aUXvE6S74QhBg%40mail.gmail.com.

Error starting :Termdebug

Hi,
I get this error running vim 8.2 when starting :Termdebug:

Error detected while processing function <SNR>2_StartDebug[2]..<SNR>2_StartDebug_internal[50]..<SNR>2_StartDebug_term:
line   97:
Cannot check if your gdb works, continuing anyway
Press ENTER or type command to continue

After a few seconds GDB starts anyway. Is there a way I can disable this error message?

Thanks,
Uri

--
--
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/f009b5ba-d49c-4746-b507-a62b7701f530n%40googlegroups.com.

Re: What is fuzzy matching?

Hi,

On Fri, Apr 30, 2021 at 2:15 AM BPJ <bpj@melroch.se> wrote:
>
>
> Den fre 30 apr. 2021 07:56Tony Mechelynck <antoine.mechelynck@gmail.com> skrev:
>>
>> On Fri, Apr 30, 2021 at 5:10 AM Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
>> >
>> > Hi Tony,
>> >
>> > On Thu, Apr 29, 2021 at 3:07 AM Tony Mechelynck
>> > <antoine.mechelynck@gmail.com> wrote:
>> > >
>> > > The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
>> > > 05", maybe that date is in error) now mentions an [f] flag without
>> > > saying what it does. One recent vim_dev thread makes me think that
>> > > with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
>> > > \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
>> > > they all assume that the reader knows what fuzzy matching is. Nowhere
>> > > did I see the expression defined. So what is fuzzy matching?
>> > >
>> >
>> > We should add a description for "fuzzy matching" to the Vim help.
>> > I will send out a PR.
>> >
>> > Fuzzy matching refers to matching strings using non-exact matches.
>> > For example, when you search for the 'get pat' string using fuzzy
>> > matching, it will match the strings 'GetPattern', 'PatternGet',
>> > 'getPattern', 'patGetter', 'getSomePattern', 'MatchpatternGet' etc.
>> >
>> > :echo matchfuzzy(['GetPattern', 'PatternGet', 'getPattern',
>> > 'patGetter', 'getSomePattern', 'MatchpatternGet'], 'get pat')
>> > ['patGetter', 'GetPattern', 'PatternGet', 'getPattern',
>> > 'getSomePattern', 'MatchpatternGet']
>> >
>> > Fuzzy matching will match a string, if all the characters in the search
>> > string are present in the string in the same order. Case is ignored during
>> > the search. Other characters can be present between two characters
>> > in the search string. If the search string has multiple words, then each word
>> > is matched separately. So the words in the search string can be present in
>> > any order in a string.
>> >
>> > Fuzzy matching assigns a score for each match based on some criteria.
>> > The match with the highest score is returned first.
>> >
>> > Regards,
>> > Yegappan
>>
>> Ah I see. So IIUC Vim's fuzzy matching will match (caselessly) if
>> there is an extra letter but not if there is a missing letter, and it
>> won't match swapped letters: if the search string is 'word', then Vim
>> will find 'WoRd' or 'worrd' but not 'wrd' or 'wrod'. Thanks for
>> explaining.
>
>
>
> IOW fuzzy 'word' is equivalent to regex 'w.*o.*r.*d.*' or '.*w.*o.*r.*d.*'?
>

When fuzzy matching a string, the case is ignored. So a fuzzy 'word' is
sort of equivalent to '\c.*w.*o.*r.*d.*', But when multiple matches are
sorted by the fuzzy match score, the match is much more than a regular
expression match. For example, the score is higher for a match with
less distance between the characters. Similarly matches at the beginning
of a word or after a camel case or underscore are given a higher
score.

- Yegappan

--
--
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/CAAW7x7m58RZj52LmqGxH7nXKFrf1aF2ZCUMxYpOQ%3Dwq0Ob0y%2Bg%40mail.gmail.com.

Re: What is fuzzy matching?


Den fre 30 apr. 2021 07:56Tony Mechelynck <antoine.mechelynck@gmail.com> skrev:
On Fri, Apr 30, 2021 at 5:10 AM Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
>
> Hi Tony,
>
> On Thu, Apr 29, 2021 at 3:07 AM Tony Mechelynck
> <antoine.mechelynck@gmail.com> wrote:
> >
> > The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
> > 05", maybe that date is in error) now mentions an [f] flag without
> > saying what it does. One recent vim_dev thread makes me think that
> > with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
> > \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
> > they all assume that the reader knows what fuzzy matching is. Nowhere
> > did I see the expression defined. So what is fuzzy matching?
> >
>
> We should add a description for "fuzzy matching" to the Vim help.
> I will send out a PR.
>
> Fuzzy matching refers to matching strings using non-exact matches.
> For example, when you search for the 'get pat' string using fuzzy
> matching, it will match the strings 'GetPattern', 'PatternGet',
> 'getPattern', 'patGetter', 'getSomePattern', 'MatchpatternGet' etc.
>
> :echo matchfuzzy(['GetPattern', 'PatternGet', 'getPattern',
> 'patGetter', 'getSomePattern', 'MatchpatternGet'], 'get pat')
> ['patGetter', 'GetPattern', 'PatternGet', 'getPattern',
> 'getSomePattern', 'MatchpatternGet']
>
> Fuzzy matching will match a string, if all the characters in the search
> string are present in the string in the same order. Case is ignored during
> the search. Other characters can be present between two characters
> in the search string. If the search string has multiple words, then each word
> is matched separately. So the words in the search string can be present in
> any order in a string.
>
> Fuzzy matching assigns a score for each match based on some criteria.
> The match with the highest score is returned first.
>
> Regards,
> Yegappan

Ah I see. So IIUC Vim's fuzzy matching will match (caselessly) if
there is an extra letter but not if there is a missing letter, and it
won't match swapped letters: if the search string is 'word', then Vim
will find 'WoRd' or 'worrd' but not 'wrd' or 'wrod'. Thanks for
explaining.


IOW fuzzy 'word' is equivalent to regex 'w.*o.*r.*d.*' or '.*w.*o.*r.*d.*'?

/bpj



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/CAJkCKXsGfxY7L1diJ3NZnnV9DyBFh4kg0jGsrcATYJG9VJVXnw%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/CADAJKhDYmcaBBbOuWJRZToUCUVtvLA1L5p58Jx4V_Sa6za8-xw%40mail.gmail.com.

Thursday, April 29, 2021

Re: What is fuzzy matching?

On Fri, Apr 30, 2021 at 5:10 AM Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
>
> Hi Tony,
>
> On Thu, Apr 29, 2021 at 3:07 AM Tony Mechelynck
> <antoine.mechelynck@gmail.com> wrote:
> >
> > The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
> > 05", maybe that date is in error) now mentions an [f] flag without
> > saying what it does. One recent vim_dev thread makes me think that
> > with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
> > \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
> > they all assume that the reader knows what fuzzy matching is. Nowhere
> > did I see the expression defined. So what is fuzzy matching?
> >
>
> We should add a description for "fuzzy matching" to the Vim help.
> I will send out a PR.
>
> Fuzzy matching refers to matching strings using non-exact matches.
> For example, when you search for the 'get pat' string using fuzzy
> matching, it will match the strings 'GetPattern', 'PatternGet',
> 'getPattern', 'patGetter', 'getSomePattern', 'MatchpatternGet' etc.
>
> :echo matchfuzzy(['GetPattern', 'PatternGet', 'getPattern',
> 'patGetter', 'getSomePattern', 'MatchpatternGet'], 'get pat')
> ['patGetter', 'GetPattern', 'PatternGet', 'getPattern',
> 'getSomePattern', 'MatchpatternGet']
>
> Fuzzy matching will match a string, if all the characters in the search
> string are present in the string in the same order. Case is ignored during
> the search. Other characters can be present between two characters
> in the search string. If the search string has multiple words, then each word
> is matched separately. So the words in the search string can be present in
> any order in a string.
>
> Fuzzy matching assigns a score for each match based on some criteria.
> The match with the highest score is returned first.
>
> Regards,
> Yegappan

Ah I see. So IIUC Vim's fuzzy matching will match (caselessly) if
there is an extra letter but not if there is a missing letter, and it
won't match swapped letters: if the search string is 'word', then Vim
will find 'WoRd' or 'worrd' but not 'wrd' or 'wrod'. Thanks for
explaining.

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/CAJkCKXsGfxY7L1diJ3NZnnV9DyBFh4kg0jGsrcATYJG9VJVXnw%40mail.gmail.com.

Re: What is fuzzy matching?

Hi Tony,

On Thu, Apr 29, 2021 at 3:07 AM Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
>
> The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
> 05", maybe that date is in error) now mentions an [f] flag without
> saying what it does. One recent vim_dev thread makes me think that
> with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
> \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
> they all assume that the reader knows what fuzzy matching is. Nowhere
> did I see the expression defined. So what is fuzzy matching?
>

We should add a description for "fuzzy matching" to the Vim help.
I will send out a PR.

Fuzzy matching refers to matching strings using non-exact matches.
For example, when you search for the 'get pat' string using fuzzy
matching, it will match the strings 'GetPattern', 'PatternGet',
'getPattern', 'patGetter', 'getSomePattern', 'MatchpatternGet' etc.

:echo matchfuzzy(['GetPattern', 'PatternGet', 'getPattern',
'patGetter', 'getSomePattern', 'MatchpatternGet'], 'get pat')
['patGetter', 'GetPattern', 'PatternGet', 'getPattern',
'getSomePattern', 'MatchpatternGet']

Fuzzy matching will match a string, if all the characters in the search
string are present in the string in the same order. Case is ignored during
the search. Other characters can be present between two characters
in the search string. If the search string has multiple words, then each word
is matched separately. So the words in the search string can be present in
any order in a string.

Fuzzy matching assigns a score for each match based on some criteria.
The match with the highest score is returned first.

Regards,
Yegappan

--
--
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/CAAW7x7k1AH-nFoWVboRNa1WQZcucC-G4pwVQrGEcv8vXBbZvZg%40mail.gmail.com.

Re: What is fuzzy matching?

On Thu, Apr 29, 2021 at 2:26 PM Bram Moolenaar <Bram@moolenaar.net> wrote:
>
>
> Tony wrote:
>
> > The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
> > 05", maybe that date is in error) now mentions an [f] flag without
> > saying what it does. One recent vim_dev thread makes me think that
> > with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
> > \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
> > they all assume that the reader knows what fuzzy matching is. Nowhere
> > did I see the expression defined. So what is fuzzy matching?
>
> It appears a part of the patch didn't end up in the git commit:
>
> When the 'f' flag is specified, fuzzy string matching
> is used to find matching lines. In this case,
> {pattern} is treated as a literal string instead of a
> regular expression. See |matchfuzzy()| for more info
> about fuzzy matching.
>

Hm, even |matchfuzzy()| is not very enlightening, but I suppose it
isn't obvious to give aCartesian definition of something fuzzy. I'll
have to go with the set of examples above |matchfuzzypos()| and with
what rwmitchell said above.

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/CAJkCKXswzWGhnYvHN_kyW8rO4_M-ssvPYstHhnr%2Bb6B3y2KyKw%40mail.gmail.com.

Re: What is fuzzy matching?

Tony wrote:

> The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
> 05", maybe that date is in error) now mentions an [f] flag without
> saying what it does. One recent vim_dev thread makes me think that
> with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
> \<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
> they all assume that the reader knows what fuzzy matching is. Nowhere
> did I see the expression defined. So what is fuzzy matching?

It appears a part of the patch didn't end up in the git commit:

When the 'f' flag is specified, fuzzy string matching
is used to find matching lines. In this case,
{pattern} is treated as a literal string instead of a
regular expression. See |matchfuzzy()| for more info
about fuzzy matching.


--
hundred-and-one symptoms of being an internet addict:
194. Your business cards contain your e-mail and home page address.

/// Bram Moolenaar -- Bram@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/202104291226.13TCQ7NG3240964%40masaka.moolenaar.net.

Re: What is fuzzy matching?

In other places, it means a non-exact match is found, allowing for misspellings or transposed letters.

What it means in this specific instance, ie: how fuzzy, how different from the original, I do not know - which is probably what you wanted to know.

On Thursday, April 29, 2021 at 6:07:37 AM UTC-4 antoine.m...@gmail.com wrote:
The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
05", maybe that date is in error) now mentions an [f] flag without
saying what it does. One recent vim_dev thread makes me think that
with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
\<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
they all assume that the reader knows what fuzzy matching is. Nowhere
did I see the expression defined. So what is fuzzy matching?

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/6b368878-0119-4b09-a5d6-98f3932c5835n%40googlegroups.com.

What is fuzzy matching?

The help for :vimgrep (in quickfix.txt with "Last change: 2021 Feb
05", maybe that date is in error) now mentions an [f] flag without
saying what it does. One recent vim_dev thread makes me think that
with the 'f' flag "fuzzy matching" is used. So I used :helpgrep
\<fuzzy\> and found several mentions of fuzzy matching, but AFAICT
they all assume that the reader knows what fuzzy matching is. Nowhere
did I see the expression defined. So what is fuzzy matching?

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/CAJkCKXu46hcgce8XNLMvsEjyaCM0E9dQd-%3DvpgKYnwg%2Bh1Yrhg%40mail.gmail.com.

Tuesday, April 27, 2021

Re: Quickfix window clearing on any change

This appears to be fixed in the ALE 3.1.0 release (only on GitHub).
vim.org has version 1.7.1 from Feb 2018 as it's last release.

David

On Tue, Apr 27, 2021 at 9:29 PM David Fishburn <dfishburn.vim@gmail.com> wrote:
Are you using any kind of linter or syntax checker plugins? I know
syntastic caused a similar problem in the past.

Nailed it.

I am using:
ALE - Asynchronous Lint Engine -- Lint while you type in Vim
http://www.vim.org/scripts/script.php?script_id=5449

:ALEDisable

Was enough to get me back to my usual preferred behaviour.
I will follow up with the author and check if I am at the current version.

Thanks for the message, it saved me a lot of time finding the culprit.

David

--
--
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/CAJ_EjQgPXAvrjaHVPFCn1YvV88pJ6-ES9%3DE-EoEo3cUXnO7xJA%40mail.gmail.com.

Re: Quickfix window clearing on any change

Are you using any kind of linter or syntax checker plugins? I know
syntastic caused a similar problem in the past.

Nailed it.

I am using:
ALE - Asynchronous Lint Engine -- Lint while you type in Vim
http://www.vim.org/scripts/script.php?script_id=5449

:ALEDisable

Was enough to get me back to my usual preferred behaviour.
I will follow up with the author and check if I am at the current version.

Thanks for the message, it saved me a lot of time finding the culprit.

David

--
--
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/CAJ_EjQhLE32uAx7HWTEa8zzqiKZdXkVfXYs%3Dyy7xjTFmAMLt4A%40mail.gmail.com.

Friday, April 23, 2021

Re: Gvim and Alt-F10

On Fri, Apr 23, 2021 at 6:26 AM cjsmall <jefferysmall@gmail.com> wrote:
>
> Following up to my own post:
>
> Tony was correct. It turns out that I CAN map the Alt-F10 key after all
> and it does do what I want withing gvim. However, if that key combo
> is not mapped, then the File pull-down menu gets displayed. I was
> confused because I have some mappings defined in .vimrc files
> local to certain directories, but I have some master unmapping
> definitions defined in my master (global) vimrc file. I was working on
> the master file first, adding gvim unmapping definitions in parallel
> with my working unmapping definitions for standard terminal use.
> In other words, I was adding gvim blocks using:
>
> if has ('gui_running')
> <additions>
> else
> <standard unmappings>
> endif
>
> None of the Alt-Fn keys were actually mapped at this point and
> thus, Alt-F10 was always failing over to the File pull-down menu.
> However, when I went to the directories where the mapping
> definitions were actually defined, then whenever I edited a file
> where Alt-F10 was actually mapped, it worked as desired!
>
> Once I realized all this, I was able to deactivate Alt-F10 from
> interacting with the File menu by making sure it was always
> defined by adding the following to the master vimrc:
>
> if has ('gui_running')
> " Stop Alt-F10 from pulling down the File menu
> nnoremap <M-F10> <nop>
> inoremap <M-F10> <nop>
> endif
>
> I hope that explanation makes sense. Sorry to bother everyone
> with my confusion as to what was actually going on. A big
> thanks to Tony for his very detailed reply.

It does indeed make sense. Using <Nop> as the {rhs} of a mapping is
the canonical way to make sure that the corresponding {lhs} does
nothing. There are rare cases where certain keys cannot be used as the
{lhs} of a mapping but usually it works.

Best regards,
Tony.
>
>
> On Thursday, April 22, 2021 at 7:18:56 PM UTC-7 cjsmall wrote:
>>
>> The window manager is possibly responsible for some of these
>> Alt assignments. In gvim. on my system, Alt-[FETSBWH] display
>> the File/Edit/Tools/Syntax/Buffers/Window/Help pull-down
>> menus. Alt-F10 is the only function key of the twelve that is
>> being co-opted and duplicating the Alt-F function. This is why
>> I thought that it might be specific to gvim and was hoping that
>> there was a way to control this externally without having to
>> recompile from scratch.
>>
>> As for the build, 8,.1 is the current package in the Ubuntu
>> repository. It is using GTK3 and was compiled a year ago
>> on 04-15-20. It would be great if Sven or someone could goose
>> the maintainer to update the package. I've tried! :-(
>>
>> On Thursday, April 22, 2021 at 5:56:48 PM UTC-7 antoine.m...@gmail.com wrote:
>>>
>>> it applies tOn Fri, Apr 23, 2021 at 12:31 AM cjsmall
>>> <jeffer...@gmail.com> wrote:
>>> >
>>> > I'm on Xubuntu 20.04 and using vim 8.1
>>> >
>>> > In gvim, the Alt-F10 key is co-opted to display the File pull-down menu. I have a series of remapped assignments for all of the function keys. These all work well for vim in a terminal window, but this single one fails due to this built-in menu assignment.
>>> >
>>> > Is there an easy way to deactivate this so that the Alt-F10 code (<M-F10>) can be assigned to my purpose?
>>> >
>>> > Thanks.
>>>
>>> You didn't say which GUI you are using (I'm using GTK3); also, Vim 8.1
>>> is getting a little long in the teeth IYSWIM. Vim 8.2 was released on
>>> 12 December 2019 and its latest patchlevel is 8.2.2800. It is
>>> conceivable that one of these two thousand eight hundred patches fixes
>>> your problem; but otherwise, see below.
>>>
>>> I'm on openSUSE 15.2 and here, hitting Alt-F10 on a virtual desktop
>>> unmaximizes the top window, no matter which one — it applies to my
>>> browser as well as to gvim. Repeating the action reverses the process.
>>> The Alt-F10 combo doesn't even reach gvim here. OTOH Alt+letter
>>> triggers (in gvim with GTK3 GUI) the menus on the menubar: Alt-F is
>>> File, Alt-E is Edit, Alt-T is Tools, etc. IIUC this behaviour depends
>>> on the 'winaltkeys' settings.
>>> See :help 'winaltkeys'
>>>
>>> If you don't want the GUI menus at all, you can disable them by
>>> removing the m flag from the 'guioptions' setting; OTOH, even without
>>> the menus-on-top there is still a separate ways to get the same menus
>>> at the bottom in both gvim and Vim, see
>>> https://vim.fandom.com/wiki/Text_mode_menus
>>>
>>> In my experience, the most portable {lhs} key assignments for mappings
>>> are F2 to F9 and F10 to F12 in both Vim and gvim, and in addition
>>> Shift-F1 to Shift-F12 in gvim. F1 is reserved for Help. F10 may either
>>> be the system menu, or it may be available too. Others might or might
>>> not work for reasons external to Vim.
>>>
>>> If when you do
>>> :verbose map <M-F10>
>>> in gvim, the answer is either "No mapping found" or your own defined
>>> mapping, then if gvim does something else when you hit that key combo,
>>> the reason is to be found outside of Vim. Maybe in the settings of
>>> your window manager, if you can get at them. Otherwise, if you still
>>> have some not yet taken mappable key (maybe a non-ASCII key like the
>>> ³² and £µ keys present on my keyboard), try moving whatevr you have on
>>> Alt-F10 to some such key.
>>>
>>> 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/e2e203a5-6da2-4b77-85e5-0a9309733b4cn%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/CAJkCKXvBz1TJLM0E6%3DvV8g%3DtSDYz-fyfmnyhVy_q8WJXOR%2BShQ%40mail.gmail.com.

Thursday, April 22, 2021

Re: Gvim and Alt-F10

Following up to my own post:

Tony was correct.  It turns out that I CAN map the Alt-F10 key after all
and it does do what I want withing gvim.  However, if that key combo
is not mapped, then the File pull-down menu gets displayed.  I was
confused because I have some mappings defined in .vimrc files
local to certain directories, but I have some master unmapping
definitions defined in my master (global) vimrc file.  I was working on
the master file first, adding gvim unmapping definitions in parallel
with my working unmapping definitions for standard terminal use.
In other words, I was adding gvim blocks using:

if has ('gui_running')
   <additions>
else
    <standard unmappings>
endif

None of the Alt-Fn keys were actually mapped at this point and
thus, Alt-F10 was always failing over to the File pull-down menu.
However, when I went to the directories where the mapping
definitions were actually defined, then whenever I edited a file
where Alt-F10 was actually mapped, it worked as desired!

Once I realized all this, I was able to deactivate Alt-F10 from
interacting with the File menu by making sure it was always
defined by adding the following to the master vimrc:

if has ('gui_running')
    "  Stop Alt-F10 from pulling down the File menu
    nnoremap  <M-F10> <nop>
    inoremap  <M-F10> <nop>
endif

I hope that explanation makes sense.  Sorry to bother everyone
with my confusion as to what was actually going on.  A big
thanks to Tony for his very detailed reply.


On Thursday, April 22, 2021 at 7:18:56 PM UTC-7 cjsmall wrote:
The window manager is possibly responsible for some of these
Alt assignments. In gvim. on my system, Alt-[FETSBWH] display
the File/Edit/Tools/Syntax/Buffers/Window/Help pull-down
menus.  Alt-F10 is the only function key of the twelve that is
being co-opted and duplicating the Alt-F function.  This is why
I thought that it might be specific to gvim and was hoping that
there was a way to control this externally without having to
recompile from scratch.

As for the build, 8,.1 is the current package in the Ubuntu
repository.  It is using GTK3 and was compiled a year ago
on 04-15-20.  It would be great if Sven or someone could goose
the maintainer to update the package.  I've tried!  :-(

On Thursday, April 22, 2021 at 5:56:48 PM UTC-7 antoine.m...@gmail.com wrote:
it applies tOn Fri, Apr 23, 2021 at 12:31 AM cjsmall
<jeffer...@gmail.com> wrote:
>
> I'm on Xubuntu 20.04 and using vim 8.1
>
> In gvim, the Alt-F10 key is co-opted to display the File pull-down menu. I have a series of remapped assignments for all of the function keys. These all work well for vim in a terminal window, but this single one fails due to this built-in menu assignment.
>
> Is there an easy way to deactivate this so that the Alt-F10 code (<M-F10>) can be assigned to my purpose?
>
> Thanks.

You didn't say which GUI you are using (I'm using GTK3); also, Vim 8.1
is getting a little long in the teeth IYSWIM. Vim 8.2 was released on
12 December 2019 and its latest patchlevel is 8.2.2800. It is
conceivable that one of these two thousand eight hundred patches fixes
your problem; but otherwise, see below.

I'm on openSUSE 15.2 and here, hitting Alt-F10 on a virtual desktop
unmaximizes the top window, no matter which one — it applies to my
browser as well as to gvim. Repeating the action reverses the process.
The Alt-F10 combo doesn't even reach gvim here. OTOH Alt+letter
triggers (in gvim with GTK3 GUI) the menus on the menubar: Alt-F is
File, Alt-E is Edit, Alt-T is Tools, etc. IIUC this behaviour depends
on the 'winaltkeys' settings.
See :help 'winaltkeys'

If you don't want the GUI menus at all, you can disable them by
removing the m flag from the 'guioptions' setting; OTOH, even without
the menus-on-top there is still a separate ways to get the same menus
at the bottom in both gvim and Vim, see
https://vim.fandom.com/wiki/Text_mode_menus

In my experience, the most portable {lhs} key assignments for mappings
are F2 to F9 and F10 to F12 in both Vim and gvim, and in addition
Shift-F1 to Shift-F12 in gvim. F1 is reserved for Help. F10 may either
be the system menu, or it may be available too. Others might or might
not work for reasons external to Vim.

If when you do
:verbose map <M-F10>
in gvim, the answer is either "No mapping found" or your own defined
mapping, then if gvim does something else when you hit that key combo,
the reason is to be found outside of Vim. Maybe in the settings of
your window manager, if you can get at them. Otherwise, if you still
have some not yet taken mappable key (maybe a non-ASCII key like the
³² and £Âµ keys present on my keyboard), try moving whatevr you have on
Alt-F10 to some such key.

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/e2e203a5-6da2-4b77-85e5-0a9309733b4cn%40googlegroups.com.

Re: Gvim and Alt-F10

The window manager is possibly responsible for some of these
Alt assignments. In gvim. on my system, Alt-[FETSBWH] display
the File/Edit/Tools/Syntax/Buffers/Window/Help pull-down
menus.  Alt-F10 is the only function key of the twelve that is
being co-opted and duplicating the Alt-F function.  This is why
I thought that it might be specific to gvim and was hoping that
there was a way to control this externally without having to
recompile from scratch.

As for the build, 8,.1 is the current package in the Ubuntu
repository.  It is using GTK3 and was compiled a year ago
on 04-15-20.  It would be great if Sven or someone could goose
the maintainer to update the package.  I've tried!  :-(

On Thursday, April 22, 2021 at 5:56:48 PM UTC-7 antoine.m...@gmail.com wrote:
it applies tOn Fri, Apr 23, 2021 at 12:31 AM cjsmall
<jeffer...@gmail.com> wrote:
>
> I'm on Xubuntu 20.04 and using vim 8.1
>
> In gvim, the Alt-F10 key is co-opted to display the File pull-down menu. I have a series of remapped assignments for all of the function keys. These all work well for vim in a terminal window, but this single one fails due to this built-in menu assignment.
>
> Is there an easy way to deactivate this so that the Alt-F10 code (<M-F10>) can be assigned to my purpose?
>
> Thanks.

You didn't say which GUI you are using (I'm using GTK3); also, Vim 8.1
is getting a little long in the teeth IYSWIM. Vim 8.2 was released on
12 December 2019 and its latest patchlevel is 8.2.2800. It is
conceivable that one of these two thousand eight hundred patches fixes
your problem; but otherwise, see below.

I'm on openSUSE 15.2 and here, hitting Alt-F10 on a virtual desktop
unmaximizes the top window, no matter which one — it applies to my
browser as well as to gvim. Repeating the action reverses the process.
The Alt-F10 combo doesn't even reach gvim here. OTOH Alt+letter
triggers (in gvim with GTK3 GUI) the menus on the menubar: Alt-F is
File, Alt-E is Edit, Alt-T is Tools, etc. IIUC this behaviour depends
on the 'winaltkeys' settings.
See :help 'winaltkeys'

If you don't want the GUI menus at all, you can disable them by
removing the m flag from the 'guioptions' setting; OTOH, even without
the menus-on-top there is still a separate ways to get the same menus
at the bottom in both gvim and Vim, see
https://vim.fandom.com/wiki/Text_mode_menus

In my experience, the most portable {lhs} key assignments for mappings
are F2 to F9 and F10 to F12 in both Vim and gvim, and in addition
Shift-F1 to Shift-F12 in gvim. F1 is reserved for Help. F10 may either
be the system menu, or it may be available too. Others might or might
not work for reasons external to Vim.

If when you do
:verbose map <M-F10>
in gvim, the answer is either "No mapping found" or your own defined
mapping, then if gvim does something else when you hit that key combo,
the reason is to be found outside of Vim. Maybe in the settings of
your window manager, if you can get at them. Otherwise, if you still
have some not yet taken mappable key (maybe a non-ASCII key like the
³² and £Âµ keys present on my keyboard), try moving whatevr you have on
Alt-F10 to some such key.

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/9c17590f-06c6-421a-bb91-d5f39d66ca3an%40googlegroups.com.

Re: Print the reference manual



On Thu, Apr 22, 2021, 19:29 Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

That would be a very heavy printout, and you would want a page break
between each pair of files.


:)

--
--
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/CAPAv2u7vt%2Bd7xAB0hn%3DMN5ETDrjogKbsK3J7etMbT2LQAVTMrg%40mail.gmail.com.

Re: Print the reference manual

If i enter

:r! cat $VIMRUNTIME/doc/*.txt

 it'll print all the help docs to a buffer. But how to select just the docs from the ref manual? Maybe a sort of "slice", all docs between doc a and b, perhaps?

On Fri, 23 Apr 2021 at 01:29, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
On Thu, Apr 22, 2021 at 10:47 AM Ailen Vienne Sebastian
<ailensebastian10@gmail.com> wrote:
>
> I know I can print a help doc to a text file with :e! cat $VIMRUNTIME/doc/filename.txt. But what about the entire reference manual? Not the user manual, the reference manual. It seems to be composed of different subfiles with different names. Is there any way to sweep through all the files in the reference manual, in order, and print them to the same text file? Thanks very much.

That would be a very heavy printout, and you would want a page break
between each pair of files.

To print the whole help (user manual _and_ reference manual), only not
the help for additional packages, you may want to start Vim with no
arguments, then set the proper print options (see ":help
print-options") and finally print them all to a file by means of

        :args $VIMRUNTIME/doc/*.txt
        :argdo hardcopy >~/vimhelp.txt
or similar

(omit ">~/vimhelp.txt" to print to an actual printer).

See
        :help :args
        :help :argdo
        :help print.txt

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/CAJkCKXvWj%3D1Sr61RfdVkKw2Aw7XXYqh%3D74KgEAeZVQmBwzKTSA%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/CA%2BCSdQH2NSseQ%3D_e7a6TgiM-bELOazf%3D6ED1Yt2dxaAVnJ16Yw%40mail.gmail.com.

Re: Gvim and Alt-F10

it applies tOn Fri, Apr 23, 2021 at 12:31 AM cjsmall
<jefferysmall@gmail.com> wrote:
>
> I'm on Xubuntu 20.04 and using vim 8.1
>
> In gvim, the Alt-F10 key is co-opted to display the File pull-down menu. I have a series of remapped assignments for all of the function keys. These all work well for vim in a terminal window, but this single one fails due to this built-in menu assignment.
>
> Is there an easy way to deactivate this so that the Alt-F10 code (<M-F10>) can be assigned to my purpose?
>
> Thanks.

You didn't say which GUI you are using (I'm using GTK3); also, Vim 8.1
is getting a little long in the teeth IYSWIM. Vim 8.2 was released on
12 December 2019 and its latest patchlevel is 8.2.2800. It is
conceivable that one of these two thousand eight hundred patches fixes
your problem; but otherwise, see below.

I'm on openSUSE 15.2 and here, hitting Alt-F10 on a virtual desktop
unmaximizes the top window, no matter which one — it applies to my
browser as well as to gvim. Repeating the action reverses the process.
The Alt-F10 combo doesn't even reach gvim here. OTOH Alt+letter
triggers (in gvim with GTK3 GUI) the menus on the menubar: Alt-F is
File, Alt-E is Edit, Alt-T is Tools, etc. IIUC this behaviour depends
on the 'winaltkeys' settings.
See :help 'winaltkeys'

If you don't want the GUI menus at all, you can disable them by
removing the m flag from the 'guioptions' setting; OTOH, even without
the menus-on-top there is still a separate ways to get the same menus
at the bottom in both gvim and Vim, see
https://vim.fandom.com/wiki/Text_mode_menus

In my experience, the most portable {lhs} key assignments for mappings
are F2 to F9 and F10 to F12 in both Vim and gvim, and in addition
Shift-F1 to Shift-F12 in gvim. F1 is reserved for Help. F10 may either
be the system menu, or it may be available too. Others might or might
not work for reasons external to Vim.

If when you do
:verbose map <M-F10>
in gvim, the answer is either "No mapping found" or your own defined
mapping, then if gvim does something else when you hit that key combo,
the reason is to be found outside of Vim. Maybe in the settings of
your window manager, if you can get at them. Otherwise, if you still
have some not yet taken mappable key (maybe a non-ASCII key like the
³² and £µ keys present on my keyboard), try moving whatevr you have on
Alt-F10 to some such key.

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

Gvim and Alt-F10

I'm on Xubuntu 20.04 and using vim 8.1

In gvim, the Alt-F10 key is co-opted to display the File pull-down menu.  I have a series of remapped assignments for all of the function keys.  These all work well for vim in a terminal window, but this single one fails due to this built-in menu assignment.

Is there an easy way to deactivate this so that the Alt-F10 code (<M-F10>) can be assigned to my purpose?

Thanks.

--
--
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/2428f9f7-4394-444f-8ef0-aa38a6ea7ff3n%40googlegroups.com.

Re: Print the reference manual

> > I know I can print a help doc to a text file with :e! cat $VIMRUNTIME/doc/filename.txt. But what about the entire reference manual? Not the user manual, the reference manual.
>
> That would be a very heavy printout, and you would want a page break
> between each pair of files.

Maybe it is more practical to buy a reknown book on Vim, like Practical
Vim, and leave the entire reference for reference. Computers are
invented to save and process larege amounts of information, and a
digital reference probably is more accessible than a printed one.

Just some thoughts...

//meine

--
--
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/YIHqlHVdHdMNcX1K%40trackstand.

Re: Print the reference manual


On Thu, Apr 22, 2021 at 3:47 AM Ailen Vienne Sebastian <ailensebastian10@gmail.com> wrote:
I know I can print a help doc to a text file with :e! cat $VIMRUNTIME/doc/filename.txt. But what about the entire reference manual? Not the user manual, the reference manual. It seems to be composed of different subfiles with different names. Is there any way to sweep through all the files in the reference manual, in order, and print them to the same text file? Thanks very much.

--
--
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/CA%2BCSdQE0hrcOo%3Df0-Tm0S8YURLzFNz31y5itZXdRObgep3aa7A%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/CAC3N25tfCDt6YD1BhTfAT3SXiSzSxKLmATiXHNQyTSK1VHVQMQ%40mail.gmail.com.

Re: Print the reference manual

On Thu, Apr 22, 2021 at 10:47 AM Ailen Vienne Sebastian
<ailensebastian10@gmail.com> wrote:
>
> I know I can print a help doc to a text file with :e! cat $VIMRUNTIME/doc/filename.txt. But what about the entire reference manual? Not the user manual, the reference manual. It seems to be composed of different subfiles with different names. Is there any way to sweep through all the files in the reference manual, in order, and print them to the same text file? Thanks very much.

That would be a very heavy printout, and you would want a page break
between each pair of files.

To print the whole help (user manual _and_ reference manual), only not
the help for additional packages, you may want to start Vim with no
arguments, then set the proper print options (see ":help
print-options") and finally print them all to a file by means of

:args $VIMRUNTIME/doc/*.txt
:argdo hardcopy >~/vimhelp.txt
or similar

(omit ">~/vimhelp.txt" to print to an actual printer).

See
:help :args
:help :argdo
:help print.txt

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/CAJkCKXvWj%3D1Sr61RfdVkKw2Aw7XXYqh%3D74KgEAeZVQmBwzKTSA%40mail.gmail.com.

Search bug/inconsistency with forward vs. backward search?

To reproduce, create an empty document with a couple of blank lines at
the top, and a non-space character (optionally indented):

$ vim -u NONE
:set wrapscan " should be the default, but just to confirm
:$put=['', 'x']

Now, search for that "first non-space character in the file" (
https://www.reddit.com/r/vim/comments/mvzpq5/how_do_i_jump_to_the_first_non_blank_character_in/ ) with:

/\%^\_s*\S/e

This will correctly find the "x" and land on it.

Using "n" will repeatedly find this same point regardless of where
you are in the document (on the "x" or not on the "x"). Good.

But if you're on the "x", using "N" to search in the reverse
direction fails with

E486: Pattern not found: \%^\_s*\S

If the cursor is elsewhere (not on the "x"), using "N" works, but then
a second "N" will fail because you're now on the "x". It's the same
pattern that was able to be found repeatedly before.

If I initate the search with

?\%^\_s*\S?e

it fails in the same way now with "n" but now "N" works as "n" did
before, leading me to suspect that there's an issue with the
search-forward vs. search-backward aspect, not the n/N aspect.

My expectation is that if I can find something searching forward, I
should be able to find that same thing by searching backward (as long
as 'wrapscan' is set)

Can anybody else confirm?

This is stock-from-packages 8.2.2725 on FreeBSD 13-RELEASE in case
that matters.

-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/20210422093535.28fe5257%40bigbox.attlocal.net.

Print the reference manual

I know I can print a help doc to a text file with :e! cat $VIMRUNTIME/doc/filename.txt. But what about the entire reference manual? Not the user manual, the reference manual. It seems to be composed of different subfiles with different names. Is there any way to sweep through all the files in the reference manual, in order, and print them to the same text file? Thanks very much.

--
--
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/CA%2BCSdQE0hrcOo%3Df0-Tm0S8YURLzFNz31y5itZXdRObgep3aa7A%40mail.gmail.com.

Wednesday, April 21, 2021

Re: Automating paragraphs (was Re: Dump help pages)

Den tis 20 apr. 2021 17:46Julius Hamilton <julkhami@gmail.com> skrev:
Thanks.

This is pretty complicated, but probably what I had in mind.

So, some basic clarification -

You defined a new command called Jp. You specify a line range, and it starts at every non blank line and joins all following non blank lines.

That's quite good. Thanks very much.

What about the second command I had in mind? I could really use a way to select a paragraph and insert N newlines between every Word (Vim "W") (and also sentence, on a separate occasion), with a single command, say in visual mode.

With your command, I can imagine it could be modified to start at every Word and just append newlines. Do you think you could write an example of this?

I came up with the following. It basically is a pair of typing-saving canned s/// command which replaces all consecutive horizontal whitespace with a given number of linebreaks throughout the buffer, in a range or in the current visual selection, in the second version restricted to horizontal whitespace after sentence-final punctuation.

" Command :Wl [{N}] (*W*ord *l*ine)
"   Replace consecutive horizontal whitespace in buffer/range/selection
"   with N line breaks (Default: the number in variable g:Wl_line_breaks)

let g:Wl_line_breaks=1

:com! -range=% -nargs=? Wl exe printf('<line1>,<line2>s/\s\+/%s/g',repeat('\r', (<q-args> ? <q-args> : g:Wl_line_breaks)))

" Explanation:
"   -range=%
"     The command operates over the whole buffer or over a given range, which
"     may be visual.
"   -nargs=?
"     The command takes an optional argument.
"   exe printf(...)
"     Constructs a string containing the actual command, then executes this
"     string as a command.
"   (<q-args> ? <q-args> : g:Wl_line_breaks)
"     Compute N: use the argument if there was one (and it was non-zero)
"     or else use the number which is the value of the global variable
"     g:Wl_line_breaks, which must be defined.
"     It is up to you to make sure that the argument and the variable value
"     are positive integers!
"   repeat('\r', N)
"     Construct a string which will be interpolated as N linebreaks.
"     The string doesn't actually contain linebreaks, but they will "become"
"     line breaks when the command is executed.
"   s/\s\+/%s/g
"     Here %s will be replaced with N linebreaks,
"     so if N is 1 it's s/\s+/\r/g
"     and if N is 4 it's s/\s+/\r\r\r\r/g
"     so basically replace all consecutive horizontal whitespace
"     with the desired number of linebreaks.

" Command :Sl [{N}] (*S*entence *l*ine)
"   Replace consecutive horizontal whitespace *after a ./?/!*
"   in buffer/range/selection with N line breaks (Default: the number in variable g:Sl_line_breaks)

let g:Sl_line_breaks=1

:com! -range=% -nargs=? Sl exe printf('<line1>,<line2>s/[.?!]\zs\s\+/%s/g',repeat('\r', (<q-args> ? <q-args> : g:Sl_line_breaks)))

" Explanation:
"   This is basically the same as above, but requires that the horizontal
"   whitespace is preceded with a "." or "?" or "!", and it has its own
"   variable for the default value of N.

" Mappings to execute :Wl/:Sl (without argument) over buffer/selection
nor Wl :Wl<cr>
nor Sl :Sl<cr>


And, how to use it on highlighted text in visual mode, instead of specifying a line range?

The commands above and the command from yesterday work on an existing or previous visual selection too. If you have a visual selection and press : the commandline is prefixed with '<,'> which is a range equal to the lines holding the visual selection. You can also insert that range manually to restrict a previously used command to the latest visual selection.

The mappings above work either on the whole buffer or the visual selection, so just make a visual selection and type Wl and it just happens in the visual selection.

In yesterday's installment the

vnor Jp :Jp<cr>

means that you can make a visual selection and just type Jp and have the :Jp command applied to the selection. Just make sure that the selection ends with a blank line. The

nnor Jp ...

line from yesterday does the same over the whole buffer in normal mode, with the difference that it first inserts a blank line at the bottom of the buffer to make sure there is one.



Thanks very much,
Julius 

It's nothing. I have been using yesterday's command/mappings for ages, and I will certainly use those from today too.

/bpj






On Tue, Apr 20, 2021, 09:13 BPJ <bpj@melroch.se> wrote:
Den fre 16 apr. 2021 19:27Stan Brown <the_stan_brown@fastmail.fm> skrev:
On 2021-04-16 09:42, Julius Hamilton wrote:

> At the beginning of a paragraph which has been separated mid-sentence
> onto separate lines, how might I automate the process of calling CTRL-J
> until all the separated lines in the paragraph have been combined into
> one line? Will Vim be able to call CTRL-J until a condition is met, for
> example, that the single line being built ends in a sentence (a period),
> or until the next line is a blank newline?

I have the following in my .vimrc :

" Command to join lines in all paragraphs in a range/the whole buffer (Jp == join paras)
:com! -range=% Jp <line>,<line>g/^\s*\S/ .,/^\s*$/-join

" Explanation:
"  :g/^\s*\S/ " Go to the first in each sequence of non-blank lines
          " Actually every non-blank line but the result is the same here!
"  .,/^\s*$/- " "Select" all lines from the current to the one before the next blank line
"  join  " Join the "selected" lines

" Mapping to join lines in all paras in the buffer
:nnor Jp Go<esc>ggVG:Jp<cr>

" Explanation:
"  G " Go to the last line in the buffer
"  o<esc> " Add a blank line below the last so we are sure there is one!
"  gg " Go to the first line in the buffer
"  V  " Visually select the (first) line
"  G  " Extend the selection to the last line in the buffer
"  :Jp<cr> " Execute the command defined above

" Mapping to execute the :Jp command over the current visual selection
:vnor Jp :Jp<cr>

HTH

/bpj


The short answer is go to the top of the paragraph and press Shift+V,
then to the bottom and press Shift+J (not Ctrl+J). You can automate this
further by writing a function that would figure out the top and bottom
of the paragraph via whatever logic you build in. See :help :function.

> Then, how might I automate the process of entering N newlines between
> every sentence? I.e., automating pressing ), i, enter a few times, then
> escape, for multiple sentences? I could create a shortcut to execute
> these commands and call it myself, or it could also repeat until the
> conditions above. How would I do either?

Example, for N = 4:
:imap <F9> <CR><CR><CR><CR><Esc>
Type the actual < and > characters as shown. To use this, at the end of
typing your paragraph do not press Esc but press F9 (or whatever key you
mapped).

If you sometimes want to insert N blank lines in already-written text,
add this:
:map <F9> A<F9>
The previous map was active in insert mode; this one is active in normal
mode. It moves to the end of the current line ("A") in insert mode and
then appends the insert-mode version of F9.

Once you've verified that these work as you wish, you can put them in
your $VIM/_vimrc file so that they will be executed whenever you start Vim.

> Also, how do I go back to where the cursor previously was, in case I
> accidentally move it?

`` or ''
(One goes back to the _line_) where you were; the other goes back to the
exact position within the line.)

--
Stan Brown
Tehachapi, CA, USA
https://BrownMath.com
https://OakRoadSystems.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/d9ee4264-13cb-eef7-be14-e0e68f9df155%40fastmail.fm.

--
--
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/CADAJKhA-3Dmp1O7XcGsJ0BPkivshP%3DWt47_nvP_sJdPwN2j64Q%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/CAGrXgp28LN5gA3KEUhCcsTieDLLTjDSA3U2SeWBpLB8AS2Rbmg%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/CADAJKhD8zmR3dKQ8C-Ck1c-%2BLeu9Ez998%2B1cTF7JTHJ1ZnwOxA%40mail.gmail.com.

Tuesday, April 20, 2021

Re: Automating paragraphs (was Re: Dump help pages)

Thanks.

This is pretty complicated, but probably what I had in mind.

So, some basic clarification -

You defined a new command called Jp. You specify a line range, and it starts at every non blank line and joins all following non blank lines.

That's quite good. Thanks very much.

What about the second command I had in mind? I could really use a way to select a paragraph and insert N newlines between every Word (Vim "W") (and also sentence, on a separate occasion), with a single command, say in visual mode.

With your command, I can imagine it could be modified to start at every Word and just append newlines. Do you think you could write an example of this? And, how to use it on highlighted text in visual mode, instead of specifying a line range?

Thanks very much,
Julius 





On Tue, Apr 20, 2021, 09:13 BPJ <bpj@melroch.se> wrote:
Den fre 16 apr. 2021 19:27Stan Brown <the_stan_brown@fastmail.fm> skrev:
On 2021-04-16 09:42, Julius Hamilton wrote:

> At the beginning of a paragraph which has been separated mid-sentence
> onto separate lines, how might I automate the process of calling CTRL-J
> until all the separated lines in the paragraph have been combined into
> one line? Will Vim be able to call CTRL-J until a condition is met, for
> example, that the single line being built ends in a sentence (a period),
> or until the next line is a blank newline?

I have the following in my .vimrc :

" Command to join lines in all paragraphs in a range/the whole buffer (Jp == join paras)
:com! -range=% Jp <line>,<line>g/^\s*\S/ .,/^\s*$/-join

" Explanation:
"  :g/^\s*\S/ " Go to the first in each sequence of non-blank lines
          " Actually every non-blank line but the result is the same here!
"  .,/^\s*$/- " "Select" all lines from the current to the one before the next blank line
"  join  " Join the "selected" lines

" Mapping to join lines in all paras in the buffer
:nnor Jp Go<esc>ggVG:Jp<cr>

" Explanation:
"  G " Go to the last line in the buffer
"  o<esc> " Add a blank line below the last so we are sure there is one!
"  gg " Go to the first line in the buffer
"  V  " Visually select the (first) line
"  G  " Extend the selection to the last line in the buffer
"  :Jp<cr> " Execute the command defined above

" Mapping to execute the :Jp command over the current visual selection
:vnor Jp :Jp<cr>

HTH

/bpj


The short answer is go to the top of the paragraph and press Shift+V,
then to the bottom and press Shift+J (not Ctrl+J). You can automate this
further by writing a function that would figure out the top and bottom
of the paragraph via whatever logic you build in. See :help :function.

> Then, how might I automate the process of entering N newlines between
> every sentence? I.e., automating pressing ), i, enter a few times, then
> escape, for multiple sentences? I could create a shortcut to execute
> these commands and call it myself, or it could also repeat until the
> conditions above. How would I do either?

Example, for N = 4:
:imap <F9> <CR><CR><CR><CR><Esc>
Type the actual < and > characters as shown. To use this, at the end of
typing your paragraph do not press Esc but press F9 (or whatever key you
mapped).

If you sometimes want to insert N blank lines in already-written text,
add this:
:map <F9> A<F9>
The previous map was active in insert mode; this one is active in normal
mode. It moves to the end of the current line ("A") in insert mode and
then appends the insert-mode version of F9.

Once you've verified that these work as you wish, you can put them in
your $VIM/_vimrc file so that they will be executed whenever you start Vim.

> Also, how do I go back to where the cursor previously was, in case I
> accidentally move it?

`` or ''
(One goes back to the _line_) where you were; the other goes back to the
exact position within the line.)

--
Stan Brown
Tehachapi, CA, USA
https://BrownMath.com
https://OakRoadSystems.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/d9ee4264-13cb-eef7-be14-e0e68f9df155%40fastmail.fm.

--
--
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/CADAJKhA-3Dmp1O7XcGsJ0BPkivshP%3DWt47_nvP_sJdPwN2j64Q%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/CAGrXgp28LN5gA3KEUhCcsTieDLLTjDSA3U2SeWBpLB8AS2Rbmg%40mail.gmail.com.