vim-plugin-autosess icon indicating copy to clipboard operation
vim-plugin-autosess copied to clipboard

Readonly stdin not working

Open zhiyb opened this issue 8 years ago • 1 comments

With autosess enabled, starting vim in readonly from stdin does not work as expected. echo "abc" | vim -R -

The content of stdin was discarded / replaced with session loading.

However, without readonly options including -R or set nomod, the content of stdin was preserved.

zhiyb avatar May 20 '17 13:05 zhiyb

A possible solution is to have autocmd StdinReadPre * let g:is_stdin = 1 and check for !exists("g:is_stdin") in VimEnter

Ref: http://stackoverflow.com/a/26673306/6383147

zhiyb avatar May 20 '17 14:05 zhiyb