When I use the command :e filename
to open a file and this file is already opened by another vim instance, I get a prompt asking me if I want to open the file in read-only mode, edit anyway, recover, exit or abort.
When I try :silent! e filename
what happens is that vim seems to have hanged. But it is indeed asking me what to do with the swapfile, just I can't see it because I told it to be silent.
Is there any command where I can tell it to open the file in read-only mode if the file can't be opened in write mode and without requiring user interaction? (I want to integrate this into a macro to jump/open files).