How to make a file writable from vim to windows?

How to make a file writable from Vim on a Windows computer? Currently, I manually view the file in Explorer, open its properties and uncheck the box for reading. I would like to be able to do it faster.

+4
source share
3 answers

Attrib seems to be a Windows shell command to change file attributes.

See :!attrib /?

:!attrib -R % should remove the Read only property in the file. (It works here, the [RO] flag is changed in my status bar).

You will be prompted to reload the file (if you do not have the autoread set): do not do this! and then save with: w!

(Rereading my question, I'm not sure if the Read-Only flag is your problem, because: w! Should work anyway.)

+7
source

Maybe something is missing for me, but :w! works for me.

+5
source

Use :saveas C:\Users\your_user_name\Desktop\temp.txt and use Explorer to copy it to its original location using UAC.

+1
source

Source: https://habr.com/ru/post/1332222/


All Articles