vimdiff of unnamed pipes

32 views
Skip to first unread message

Peng Yu

unread,
Mar 11, 2020, 10:29:53 PM3/11/20
to vim_use
Hi,

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.

--
Regards,
Peng

Tim Chase

unread,
Mar 11, 2020, 10:44:53 PM3/11/20
to vim...@googlegroups.com
On 2020-03-11 21:29, 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.

Could you detail how you're using these unnamed pipes?

I tried (using a bashism)

$ vimdiff <(seq 10) <(seq 10 | sed 5d)

and then resized the terminal window on the resulting diff and
everything worked fine (vim8.1.2372 in an xterm on FreeBSD),
displaying/highlighting the one deleted line.

Additional details might also be relevant:

- your OS?

- your window-manager (if not Windows/Mac)

- which terminal emulator? (xterm, rxvt, st, ...)

- which shell? (bash, zsh, tcsh, ksh, /bin/sh, ash/dash, fish...)

- which version of vim?

- are you running in a terminal multiplexer (like tmux or GNU screen)?

- are you using some method

- are you launching vim with any plugins or non-default settings?
(does the behavior occur if you disable plugins and startup scripts)

Answers to these questions will help attempt to narrow down or
replicate the issue.

-tim


Benjamin Esham

unread,
Mar 15, 2020, 2:17:49 AM3/15/20
to vim...@googlegroups.com
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

Peng Yu

unread,
Mar 16, 2020, 7:30:49 PM3/16/20
to vim_use
Hi,

This seems to be a quite old vim file for XQuery.

https://github.com/jeroenp/vim-xquery-syntax

This is also very old and seems to be buggy.

https://github.com/vim-scripts/XQuery-indentomnicompleteftplugin/blob/master/ftplugin/xquery.vim

Are there updated XQuery indentation and syntax files to be used? Thanks.

--
Regards,
Peng

Peng Yu

unread,
Mar 16, 2020, 7:40:35 PM3/16/20
to vim...@googlegroups.com
PS. The original message was burried under a wrong thread. So I resend
this message.

--
Regards,
Peng
Reply all
Reply to author
Forward
0 new messages