vim:autocmd: Do not mark stdin as modified

Set `nomodified` after reading from standard input. This way the buffer
can be closed without error message.

This will **not** disable modified warnings completely. If the input is
modified after read, vim will reset `modified` (As it should).
This commit is contained in:
2022-10-16 02:01:25 +02:00
parent 39e8b266d0
commit bc0affc832

View File

@@ -62,3 +62,9 @@ augroup highlight_current_word
au CursorHold * call HighlightCurrentWord()
au CursorMoved * match
augroup END
" Do not mark input from stdin as modified
augroup stdin_not_modified
au!
au StdinReadPost * set nomodified
augroup END