Hm. Just a wild thought (untested): try the following (which assumes
'nocompatible'):
if has('autocmd')
au VimEnter * augroup nomodif
au VimEnter * au BufReadPost,BufNewFile * if &buftype == ""
\ | let &l:ma = &l:ro | endif
au VimEnter * augroup END
endif
Then restart Vim (every time you make changes to your vimrc, and after
saving your changes) in order to test it.
If it doesn't work: while editing a file where 'modifiable' is not what
you expect:
:verbose setlocal ma? ro? bt?
Best regards,
Tony.
--
A disciple of another sect once came to Drescher as he was
eating his morning meal. "I would like to give you this personality
test", said the outsider, "because I want you to be happy."
Drescher took the paper that was offered him and put it into
the toaster -- "I wish the toaster to be happy too".
Won't work. The problem seen here was a netrw bug that prevented the
'readonly' option from being set properly. This autocmd will still
fail because the readonly option is not being set.
I believe this issue in netrw was fixed, I vaguely remember reading
something on vim_dev. But, I don't recall the version it was fixed in.
Chip?
Anyway, I tried
au BufReadPost * if &readonly | set nomodifiable | endif
with the latest netrw (v139e) and if a file was r--r--r-- (ie. read
only), then it got marked nomodifiable. So may I suggest to the OP that
he use http://mysite.verizon.net/astronaut/vim/index.html#NETRW .
HTH,
Chip Campbell