Saturday, March 14, 2020

Re: vimdiff of unnamed pipes

Peng Yu wrote:

> If I vimdiff unnamed pipes, when I change the terminal window size,
> the contents in vim window will disappear. Is this a bug? Is there a
> way to circumvent this problem? Thanks.

I had a similar problem a couple of weeks ago! In my case, it was because I
have the 'autoread' option set by default. See

:help 'autoread'

It seems that when the window size changes, Vim tries to reread the contents
of the pipe, but those contents aren't there anymore and so you just get an
empty file. In my experience, you can prevent this specific problem with the
autocommand

autocmd BufRead /dev/fd/* setlocal noautoread

This will disable the rereading behavior only for the ephemeral "files" you
get by reading from pipes. (This works for me on macOS but you might have to
do something different on other OSes.)

Hope this helps,

Benjamin

--
Benjamin Esham
https://esham.io

--
--
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/k7pmafuo.h23z97%40bdesham.net.

No comments: