How to quiet the message when filtering...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to quiet the message when filtering...

J S-3
I have a line in a shell script like:

vim -c '%!someFilter' someFile

The idea is to run the contents of someFile through someFilter before doing further editing.

It works fine, except for one thing.  After the filter runs, but before displaying the file onscreen, it displays a message at the bottom of the screen saying something like "60 lines filtered.  Press any key to continue", after which it then clears the screen and displays the file for normal editing.

There is no need for that message and pause.  I would like it to go directly into the vi editing mode.  Is there any way to do that?

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1537497916.2054480.1597597359837%40mail.yahoo.com.
Reply | Threaded
Open this post in threaded view
|

How to quiet the message when filtering...

Bantu Tu
vim -c 'sil%!someFilter' someFile

:h :sil

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/945ce29d-b11f-4c48-9b5f-c5271b355af4o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

J S-3
In reply to this post by J S-3
Yes! "sil" works well - in the simple case. Thanks for that.

Now, on to the next. Suppose we have another command like:

vim -c '...' -c '...' -c '...' and so on and so forth - a long series of commands that modify the text, then finally dump me into the editor. I want all of them silenced - and it to go directly into the editor with no pausing. Assume it is either impractical or impossible to put "sil" in front of every command.

Is there a some setting or other to turn on silent mode globally?

On Sunday, August 16, 2020, 01:03:02 PM EDT, 'J S' via vim_use <[hidden email]> wrote:


I have a line in a shell script like:

vim -c '%!someFilter' someFile

The idea is to run the contents of someFile through someFilter before doing further editing.

It works fine, except for one thing.  After the filter runs, but before displaying the file onscreen, it displays a message at the bottom of the screen saying something like "60 lines filtered.  Press any key to continue", after which it then clears the screen and displays the file for normal editing.

There is no need for that message and pause.  I would like it to go directly into the vi editing mode.  Is there any way to do that?

--
--
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+[hidden email]
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1537497916.2054480.1597597359837%40mail.yahoo.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1716265748.2602541.1597711876459%40mail.yahoo.com.
Reply | Threaded
Open this post in threaded view
|

unsubscribee in vim_use group

Anton Wessel
In reply to this post by Bantu Tu
please do.not send me any emails more.
your given link is not an existing email address.
[hidden email]




Gesendet mit der Telekom Mail App



--- Original-Nachricht ---
Von: Bantu Tu
Betreff: How to quiet the message when filtering...
Datum: 17. August 2020, 16:28
An: vim_use




vim -c 'sil%!someFilter' someFile

:h :sil

--
--
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 [hidden email]
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/945ce29d-b11f-4c48-9b5f-c5271b355af4o%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1597734333420.1282005.3e4f222fe5a58b7d8d2360c46b89941629ca0a28%40spica.telekom.de.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

Christian Brabandt
In reply to this post by J S-3

On Di, 18 Aug 2020, 'J S' via vim_use wrote:

>  Yes! "sil" works well - in the simple case. Thanks for that.
>
> Now, on to the next. Suppose we have another command like:
>
> vim -c '...' -c '...' -c '...' and so on and so forth - a long series of commands that modify the text, then finally dump me into the editor. I want all of them silenced - and it to go directly into the editor with no pausing. Assume it is either impractical or impossible to put "sil" in front of every command.
>
> Is there a some setting or other to turn on silent mode globally?

You can try to use the -s and -e option (see :h -s-ex)

This may or may not help, I don't know for sure.

Best,
Christian
--
F: Warum haben Giraffen so einen langen Hals?
A: Weil der Kopf so weit oben ist.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200818081917.GA17606%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: unsubscribee in vim_use group

Christian Brabandt
In reply to this post by Anton Wessel

Anton Wessel schrieb am Dienstag, den 18. August 2020:

> please do not send me any emails more.

If you read each message carefully, you'll notice this at the bottom:

> 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 [hidden email].
> <mailto:[hidden email].>
> To view this discussion on the web visit
> <https://groups.google.com/d/msgid/vim_use/945ce29d-b11f-4c48-9b5f-c5271b355af4o%40googlegroups.com>

So please send a mail to the given email address. For now I have set
your membership to not receive any message, but I cannot unsubscribe
you.

Best,
Christian
--
Ich bin nicht immer Deiner Meinung.
                -- Paul Ambroise Valéry

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200818082531.GB17606%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

J S-3
In reply to this post by Christian Brabandt
Actually, I figured out from the help file a workaround, which is to put all the commands into a function and then do: silent call Function()

It is funny how often functions are the workaround for a lot of the quirks in the Vim ecosystem.

Anyway, I think I will go with that - at least for now - but I will look into the '-s-ex' option at some later time (I did read about it; just haven't tested it yet). Thanks.

P.S. It still seems to me like there should be an option, like "set silent/set nosilent' to just turn it on/off globally. That sounds like something that should be included in a future version.
On Tuesday, August 18, 2020, 04:19:36 AM EDT, Christian Brabandt <[hidden email]> wrote:



On Di, 18 Aug 2020, 'J S' via vim_use wrote:

>  Yes! "sil" works well - in the simple case. Thanks for that.
>
> Now, on to the next. Suppose we have another command like:
>
> vim -c '...' -c '...' -c '...' and so on and so forth - a long series of commands that modify the text, then finally dump me into the editor. I want all of them silenced - and it to go directly into the editor with no pausing. Assume it is either impractical or impossible to put "sil" in front of every command.
>
> Is there a some setting or other to turn on silent mode globally?

You can try to use the -s and -e option (see :h -s-ex)

This may or may not help, I don't know for sure.

Best,
Christian
--
F: Warum haben Giraffen so einen langen Hals?
A: Weil der Kopf so weit oben ist.


--
--
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+[hidden email]

To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200818081917.GA17606%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1569074652.2740034.1597752106396%40mail.yahoo.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

Christian Brabandt

On Di, 18 Aug 2020, 'J S' via vim_use wrote:

>  Actually, I figured out from the help file a workaround, which is to put all the commands into a function and then do: silent call Function()
>
> It is funny how often functions are the workaround for a lot of the quirks in the Vim ecosystem.
>
> Anyway, I think I will go with that - at least for now - but I will look into the '-s-ex' option at some later time (I did read about it; just haven't tested it yet). Thanks.
>
> P.S. It still seems to me like there should be an option, like "set silent/set nosilent' to just turn it on/off globally. That sounds like something that should be included in a future version.

If possible we want to avoid adding yet another Option.

Best,
Christian
--
Ist die Bundesregierung "das Böse"?  Natürlich nicht!  Das Böse müssen
wir uns als etwas Großes vorstellen - da kann es die Bundesregierung schon
mal nicht sein.  Da würden wir dem Bösen nicht gerecht.
                -- Georg Schramm

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200818141429.GD17606%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

J S-3

So, having worked with it a bit, I'm now content with using "silent" to solve this issue. Although a little convoluted, it seems pretty straightforward to put all the commands into a function, and then create a command to call that function with silent. I.e..:

command! MyCommand silent call MyFunction()

Then everything works as expected with MyCommand.

But I am curious as to why you say that the Vim Developers are trying to avoid adding options. Is there any intrinsic reason why adding options is undesirable?

Is it just "feature creep" - i.e., if you do it for me, then you have to do it for the next guy and the next guy and so on?
On Tuesday, August 18, 2020, 10:14:50 AM EDT, Christian Brabandt <[hidden email]> wrote:



On Di, 18 Aug 2020, 'J S' via vim_use wrote:

>  Actually, I figured out from the help file a workaround, which is to put all the commands into a function and then do: silent call Function()
>
> It is funny how often functions are the workaround for a lot of the quirks in the Vim ecosystem.
>
> Anyway, I think I will go with that - at least for now - but I will look into the '-s-ex' option at some later time (I did read about it; just haven't tested it yet). Thanks.
>
> P.S. It still seems to me like there should be an option, like "set silent/set nosilent' to just turn it on/off globally. That sounds like something that should be included in a future version.

If possible we want to avoid adding yet another Option.

Best,
Christian
--
Ist die Bundesregierung "das Böse"?  Natürlich nicht!  Das Böse müssen
wir uns als etwas Großes vorstellen - da kann es die Bundesregierung schon
mal nicht sein.  Da würden wir dem Bösen nicht gerecht.
        -- Georg Schramm


--
--
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+[hidden email]

To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200818141429.GD17606%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/847320844.3414086.1597864276900%40mail.yahoo.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to quiet the message when filtering...

Andy Wokula
Am 19.08.2020 um 21:11 schrieb 'J S' via vim_use:
> But I am curious as to why you say that the Vim Developers are trying
> to avoid adding options. Is there any intrinsic reason why adding
> options is undesirable?

I think it's more about the option in question:
(1) a global silent mode can too easily make your editor unusable
(2) you can already use :sil + function call

So there is not even a use case (besides stupid pranks maybe).

--
Andy

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5F3E6413.3050600%40yahoo.de.