I have a script which performs some action and then pipes the stdout to Neovim so that I can look at it with syntax highlighting and do all the other nice things I can do with vim.However, as this is a temporary file just used for inspecting the (possibly very long) output of the command, I almost never want to actually save the file. When I :q to exit, I get E37: No write since last change (add ! to override) as expected.I've tried :set ro but I still get E37 when exiting. I could of course train myself to just use :q! for this particular scenario, but I'd rather come up with a better solution.Is there some argument I can pass to nvim in my script that will prevent E37 when I :q?
How can I open a temporary file so that I don't get E37: No write since last change?
buffers;save
You can use :set buftype=nowrite or :set buftype=nofileFrom :help 'buftype':nofile        buffer which is not related to a file and will not be                writtennowrite       buffer which will not be written[..]nofile and nowrite buffers are similar:both:           The buffer is not to be written to disk, :w doesn't                work (:w filename does work though).both:           The buffer is never considered to be 'modified'.                There is no warning when the changes will be lost, for                example when you quit Vim.both:           A swap file is only created when using too much memory                (when 'swapfile' has been reset there is never a swap                file).nofile only:    The buffer name is fixed, it is not handled like a                file name.  It is not modified in response to a :cd                command.both:           When using :e bufname and already editing bufname                the buffer is made empty and autocommands are                triggered as usual for :edit.In your case, it doesn't matter all that much which one you use.