On 2019-01-04, Mahmoud Al-Qudsi wrote:
> The following should exit without a prompt:
> 
> shuf /usr/share/dict/words -n 200 | vim +"set readonly" -
> :q<CR>
> 
> but currently throws error 37:
> 
> E37: No write since last change (add ! to override)

Readonly or not, it's still true that the buffer has not been
written since it was last changed.  You would see the same message
if you ran view (or "vim -R" or "vim +'set readonly'"), made changes
to the buffer, and tried to exit with :q.

I have the following in my vimrc to avoid this problem.

    " Fix the problem where when vim reads from stdin, it marks the
    " buffer as modified so that you have to quit with :q!.
    "
    autocmd StdinReadPost * set nomodified

Regards,
Gary

-- 
-- 
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.

Raspunde prin e-mail lui