Tuesday, April 14, 2020

Re: indent file from command line without blinking

>> I think it refers to painting the vim GUI, possibly switching to the
>> alternate screen, then clearing the (possibly alternate screen), then
>> possibly restoring the (non-)alternate screen, creating a "flash"
>> effect when scripting vim.
>
> Since this depends on the terminal, you can either pretend using a dumb
> terminal:
>
> TERM=dumb vim -n -X -E -c 'normal gg=G' -c 'x' file.sh < /dev/tty

$ TERM=dumb vim -n -X -E -c 'normal gg=G' -c x
/tmp/mktemp/tmp.qfqXJ1jHwd/file2.sh
3 lines indented
"/private/tmp/mktemp/tmp.qfqXJ1jHwd/file2.sh" 3L, 44C written

> or alternatively use set the `t_ti` and `t_te` terminal options to
> empty:
>
> vim -n --cmd ':set t_ti= t_te=' -X -E -c 'normal gg=G' -c 'x' file.sh <
> /dev/tty

$ vim -n --cmd ':set t_ti= t_te=' -X -E -c 'normal gg=G' -c x
/tmp/mktemp/tmp.OLOOB8goR1/file2.sh
3 lines indented
"/private/tmp/mktemp/tmp.OLOOB8goR1/file2.sh" 3L, 44C written

I still get something printed. How to turn it off? So `< /dev/tty` is
not needed anymore for both cases?

--
Regards,
Peng

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

No comments: