Reputation: 820
How do I make a file writable from Vim on a Windows machine? I currently manually go find the file in explorer, open it's properties and uncheck readonly. I would like to be able to do this more quickly.
Upvotes: 4
Views: 1951
Reputation: 42238
It seems attrib
is the Windows shell command to modify file attributes.
See :!attrib /?
:!attrib -R %
should remove the Read only property on the file. (It is working here the [RO] flag is modified in my status bar).
You will be prompted to reload the file (if you don't have autoread
set) : don't ! and then save with :w!
(Rereading your question I am not sure that the Read only flag is your issue there because :w! should work anyway. )
Upvotes: 8
Reputation: 79185
Use :saveas C:\Users\your_user_name\Desktop\temp.txt
and use explorer to copy it to its original location with UAC.
Upvotes: 1