Tuesday, September 22, 2026

Re: No error with ]s when nowrapscan?

On Tue, 22 Sept 2026 at 22:42, Tim Chase <vim@tim.thechases.com> wrote:
On 2026-09-22 22:06, Doug Kearns wrote:
> >   $ vim one.txt two.txt three.txt
> >   :set hidden nowrapscan
> >
> > I then repeatedly issued
> >
> >   :try | exec 'norm ]s' | catch | n | endtry
> >
> > (using @: then subsequently @@ makes this easy) which worked for
> > finding all the misspelled words in the *first* file, but after
> > finding the last one in that file, the ]s *should* fail because
> > there is no "next" bad-spelling in the current file and wrapscan is
> > off.  So it seems like the ]s *should* have thrown an exception, get
> > caught, and then go to the :next file instead where the process can
> > repeat.  But it seems to silently swallow the "no more bad spellings
> > in the current file" without letting me catch the condition.
[snip]
> You could leverage temporary use of `:set debug=beep`.

A promising proposition, but I'm not sure that's working for me?

I tried the your suggestion with each of

  debug=beep
  debug=throw
  debug=throw,beep

but none of them change the behavior of the ]s (not) throwing an error
to get caught.  I do see "Beep!" text at the bottom of my screen when I
expect the exception/catch, but no catchable error seems to happen.

Yes, I was thinking you could test for that text calling execute().  I also forgot there's an assert_beeps() but you'd probably want to save restore v:errors.

Perhaps just checking for a change in cursor position is good enough?

Regards,
Doug [not in a dev environment]

--
--
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/CAJ1uvoBK3VZrh-FM1qBEtMnCcAdXGKnBK%2B1QKJLsteZgy_FmZw%40mail.gmail.com.

Re: No error with ]s when nowrapscan?

On 2026-09-22 22:06, Doug Kearns wrote: > > $ vim one.txt two.txt three.txt > > :set hidden nowrapscan > > > > I then repeatedly issued > > > > :try | exec 'norm ]s' | catch | n | endtry > > > > (using @: then subsequently @@ makes this easy) which worked for > > finding all the misspelled words in the *first* file, but after > > finding the last one in that file, the ]s *should* fail because > > there is no "next" bad-spelling in the current file and wrapscan is > > off. So it seems like the ]s *should* have thrown an exception, get > > caught, and then go to the :next file instead where the process can > > repeat. But it seems to silently swallow the "no more bad spellings > > in the current file" without letting me catch the condition. [snip] > You could leverage temporary use of `:set debug=beep`. A promising proposition, but I'm not sure that's working for me? I tried the your suggestion with each of debug=beep debug=throw debug=throw,beep but none of them change the behavior of the ]s (not) throwing an error to get caught. I do see "Beep!" text at the bottom of my screen when I expect the exception/catch, but no catchable error seems to happen. -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 visit https://groups.google.com/d/msgid/vim_use/arJ3qtqAZvkO2pNO%40thechases.com.

Re: No error with ]s when nowrapscan?

Hi Tim,

On Tue, 22 Sept 2026 at 03:25, Tim Chase <vim@tim.thechases.com> wrote:
Playing with something recently, I discovered that ]s doesn't seem to
throw any sort of error when wrapscan is off and it hits the end of the
file.

To demonstrate with the following setup (where {one,two,three}.txt are
some files with a couple misspelled words scattered throughout each)

  $ vim one.txt two.txt three.txt
  :set hidden nowrapscan

I then repeatedly issued

  :try | exec 'norm ]s' | catch | n | endtry

(using @: then subsequently @@ makes this easy) which worked for finding
all the misspelled words in the *first* file, but after finding the
last one in that file, the ]s *should* fail because there is no "next"
bad-spelling in the current file and wrapscan is off.  So it seems like
the ]s *should* have thrown an exception, get caught, and then go to
the :next file instead where the process can repeat.  But it seems to
silently swallow the "no more bad spellings in the current file" without
letting me catch the condition.

AFAICT there's no

  :spellnext

type ex command or spellnext() function corresponding to ]s that might
be more error-cooperative.

Is there a better way to go about this? 

You could leverage temporary use of `:set debug=beep`.

Regards,
Doug 

--
--
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/CAJ1uvoC%3DwuKB3u3kA4%3D4Hp1LHSoiK%3De-cz44ts79kyXeSt9R0g%40mail.gmail.com.

Monday, September 21, 2026

No error with ]s when nowrapscan?

Playing with something recently, I discovered that ]s doesn't seem to throw any sort of error when wrapscan is off and it hits the end of the file. To demonstrate with the following setup (where {one,two,three}.txt are some files with a couple misspelled words scattered throughout each) $ vim one.txt two.txt three.txt :set hidden nowrapscan I then repeatedly issued :try | exec 'norm ]s' | catch | n | endtry (using @: then subsequently @@ makes this easy) which worked for finding all the misspelled words in the *first* file, but after finding the last one in that file, the ]s *should* fail because there is no "next" bad-spelling in the current file and wrapscan is off. So it seems like the ]s *should* have thrown an exception, get caught, and then go to the :next file instead where the process can repeat. But it seems to silently swallow the "no more bad spellings in the current file" without letting me catch the condition. AFAICT there's no :spellnext type ex command or spellnext() function corresponding to ]s that might be more error-cooperative. Is there a better way to go about this? -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 visit https://groups.google.com/d/msgid/vim_use/arFobflska4lvgtE%40thechases.com.

Tuesday, September 8, 2026

Re: timer_start to refresh rulerformat

and then it worked, after update I guess to vim 9.2 (including patch 1-1011) \o/ thank you. -- -- 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/14308c5f-ff74-4430-9d91-9d221b9888f8%40sfr.fr.

Monday, September 7, 2026

Re: ShellCmdPre autocommand ?

hello, On Mon, Sep 07, 2026 at 05:30:56PM -0700, Maxim Kim wrote: > What about  > :!<CTRL-R><CTRL-f> ? worth to mention but something like :r!dpkg -r <cfile> is reusable from history so you can type it once and use it repeatedly and <cfile> updated. not only :r!dpkg -r $c is faster to type and less error prone but as it is a environment variable, I can use it it a custom script. I can also imagine exporting more informations like getline(), line(), col() ... anyway: I never use <c-r><c-f> but it's worth to mention the <c-r>* during the talk. Thank you! -- Marc Chantreux ☎ 03.68.85.60.79 -- -- 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/ap-aW3-HCOwXGhX-%40prometheus.

Re: ShellCmdPre autocommand ?

What about 

:!<CTRL-R><CTRL-f>

?

On Sunday, September 6, 2026 at 8:33:53 PM UTC+10 Marc Chantreux wrote:
hello vimmers,

A. The problem

* the use of expansions like <cfile> is very powerful but typing
those are boring and error prone ( < cfile> is a shell redir)
* sometimes it can be really usefull to have the content of <cfile>
as an exported variable.
* environment variables have autocompletion, vim expansions doesn't

:r!dpkg -r <cfile>

B. The solutions

There are many but I came to the idea that the most reusable feature
would be the ShellCmdPre autocommand (ShellCmdPost already exists).

I have no time to dive into vim developpement but if needed, I'll be
happy to sponsor it (I think Christian Brabandt asked for financial help
so he can spend more time on vim)

thanks for any feedbacks.


C. The context

In few months, I'll give a new version of the talk "acme changed my life"
https://github.com/eiro/talk-acme-changed-my-life in which I explain
that "!" by far the most underated feature of vi and all its clone and
the basics of it.

In this new version, I'll instist on another underated features: vim
expansions with expressions like

:e <cfile>/README
:r!dpkg -r <cfile>

and the way it can interact with features outside of vim. as exemple:
if you have suffix aliases set up in your ~/.zlogin, you can just type

:!<cfile>

to open a file. you can possibly map it to something like <space>x as
it's really generic.

but there the problem I mentionned before and what I really would like
is to introduce something like

au ShellCmdPre {
$f = expand('<cfile>')
$F = expand('<cFILE>')
$w = expand('<cword>')
$W = expand('<cWORD>')
}

so now I just need to type

:!$f

--
Marc Chantreux

--
--
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/ffcfb07a-ff6c-402c-aaf8-839bae034effn%40googlegroups.com.