Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make a file writable from vim in windows?

Tags:

vim

windows

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.

like image 730
Tom Miller Avatar asked Dec 09 '22 12:12

Tom Miller


2 Answers

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. )

like image 59
Xavier T. Avatar answered Dec 22 '22 11:12

Xavier T.


Maybe I am missing something but :w! works for me.

like image 30
heijp06 Avatar answered Dec 22 '22 12:12

heijp06