Benjamin Fritz wrote:
On Tue, Jun 29, 2010 at 2:24 AM, Tony Mechelynck
<[email protected]> wrote:
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
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?
Just noticed this (almost didn't, I was about to delete old email) --
and I already had cleaned out most of the original part of the thread.
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
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php