On Sat 8 Aug 2015 at 03:45:26PM +0200, Bram Moolenaar wrote:
>
> Sung Pae wrote:
>
> > Hello vim_dev,
> >
> > Currently, `:silent[!] !cmd` does not redraw the screen after returning
> > from a shell execution, requiring a manual redraw. A simple patch
> > follows inline, but IIRC this has been discussed before without a
> > resolution.
> >
> > Is there a reason we could not redraw the screen in this case?
>
> The whole point of using :silent with a shell command is to avoid the
> redraw. It may cause the hit-enter prompt to show up. See the
> documentation:
>
> Vim redraws the screen after the command is finished,
> because it may have printed any text. This requires a
> hit-enter prompt, so that you can read any messages.
> To avoid this use: >
> :silent !{cmd}
> < The screen is not redrawn then, thus you have to use
> CTRL-L or ":redraw!" if the command did display
> something.
What is the utility of running `:silent !` without a redraw afterwards?
The screen is always swapped on :!, and :silent suppresses the hit-enter
prompt. Together, a redraw is always necessary after a `:silent !`.
> The whole point of using :silent with a shell command is to avoid the
> redraw.
>From a user perspective, the primary use of `:silent !` is to avoid the
hit-enter prompt. The advantages vs system() are:
1. :silent can be used with user-defined commands that invoke :!
2. `:silent !cmd | less` will successfully invoke the pager, then
immediately return to vim after exit, saving a keystroke
3. `:sil !…` is more ergonomic than `:call system("…")`, so it tends
to be used even when system() should be preferred.
Thank you for your time.
Sung Pae
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature
