Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable warning in VIM?

Is there a way to disable warnings in VIM?

In particular, I want to disable Warning 12 when a file turns from read-only to writable. I have a script which opens the file for edit in perforce, but vim thinks the file has changed and issues a warning.

Thanks

like image 607
Christopher Stott Avatar asked Jul 08 '09 01:07

Christopher Stott


1 Answers

I have the following in my .vimrc; you should only need the second one. It echoes the message to the status bar instead of popping up a dialog.

autocmd FileChangedRO * echohl WarningMsg | echo "File changed RO." | echohl None
autocmd FileChangedShell * echohl WarningMsg | echo "File changed shell." | echohl None

Try :help FileChangedShell for more information.

like image 64
ars Avatar answered Sep 24 '22 00:09

ars