I'm using Perforce with Vim on Windows. I currently have an auto command set up to open a read-only file for edit when changing it:
au FileChangedRO * !p4 edit <afile>
Is there any way to set up a similar auto command to execute p4 edit
when attempting to write a read-only file rather than edit it?