> On 12/18/2011 03:39 AM, John Beckett wrote:
>
>> :setl noma
>> :help 'modifiable'
>
> Than you, John. And could you say, how to set this flag automatically
> for readonly buffers.
>
It is possible, but maybe not desired:
- If only 'readonly' is set, you can modify the buffer (Vim will warn
you the first time IIRC) but not save it without either a bang (as in
:w!) or a name change (as in :saveas barfoo)
- If 'nomodifiable' is set, you cannot even modify the buffer: this is
used e.g. for helpfiles.
If you force 'ma' to always be the converse of 'ro' you lose the
possibility to (a) modify a readonly file then save it with a different
name, or (b) edit a file which is readonly on disk (has no w permission
on Unix, or has an R flag on FAT filesystems).
If you really want to do it (which I don't recommend) you could do it as
follows:
:au BufReadPost * if &l:ro | setlocal noma | endif
AFAIK there's no way to intercept the case where you set 'readonly'
manually: you will have to train yourself to do ":setlocal ro noma"
(without the quotes of course) instead of just ":setlocal ro".
Best regards,
Tony.
--
If the aborigine drafted an IQ test, all of Western civilization would
presumably flunk it.
-- Stanley Garn
--
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
No comments:
Post a Comment