On Do, 16 Nov 2023, 'Aaron Heifetz' via vim_use wrote:
> I wonder how it is possible to react to changes to a buffer's readonly flag
> both,
> - after starting vi, e.g. with gvim -c "set ro" (not gvim -R), and
> - when changing the flag via the command line.
I don't understand the difference between those two checks. For the
first one, you can call a function on VimEnter, check the flag and set
your background color, see also the 'wincolor' setting. But how do you
change the flag via the command line, if not during startup?
You may also trigger a function on an OptionSet autocommand, that reacts
to setting those option values after startup.
Thanks,
Christian
--
Hell is empty and all the devils are here.
-- Wm. Shakespeare, "The Tempest"