I use gvim on Windows. How can I open a new file?
I have tried with :e ~\mypath\myfile.txt
but I get this error message:
E303: Unable to open swap file for "C:\Users\Jonas\mypath\myfile.txt", recovery impossible
How to open a new file using gvim on Windows?
Best Answer
Solution 1
This seem to be a bug. From Vim E303: Unable to open swap file for "[No Name]", recovery impossible, I should add this to
_gvimrc
:Solution 2
To clarify the location of files and directories, which aren't immediately obvious, here is another solution.
Make the following directories (e.g., from a command prompt):
Note that
%HOMEPATH%
equalsC:\Users\User.Name
, where "User.Name" is your Windows user name.Then copy the following into
%HOMEPATH%\_vimrc
:Save the file and the error should go away.