tags:

views:

48

answers:

2

There is a particular file on my computer that Vim insists on opening in readonly mode. I checked the permissions on the file (I have full control), and if I do :w!, writes happen just fine. However, whether I open the file with :e or from NERDTree, the file opens as readonly. All other files I open work just fine.

I just want to know how to turn off readonly mode on this file, before or after I open it.

I'm on Windows, using gVim

EDIT: Its probably not a permissions issue, since :w! works just fine.

A: 

Simply force the file to be written-to by using :w!. You should be golden

Braden
He already said that he can do that fine, but he just doesn't want to have to do that. :)
Dave
A: 

Maybe there is a vim setting in the file to make the file load as read only :

Check for a line like : (substitute the comment char of your file instead of //)

// vim:set ro:

Vim looks for these settings in the first or last 5 lines of the file.

Peter Tillemans
doesn't look like there's a line like this in the file. didn't know you could do this with vim though.
Tom McJones