7

When entering or doing any command mode modifications to a read only file for the first time you will get the warning

W10: Warning: Changing a readonly file

That's fine, but this also introduces a second or two delay before the action actually happens.

Is there a way to disable this delay?

2

Short version: there is no way to disable this, or to shorten the 1 second timeout :-( The good news is that you can just start typing while this message is being displayed, the characters are still inserted.


Longer version: from misc1.c:

    if (msg_silent == 0 && !silent_mode)
    {
        out_flush();
        ui_delay(1000L, TRUE); /* give the user time to think about it */
    }

The msg_silent is set when using :silent, for example :s/./a/ will give the warning, but :silent s/./a/ won't. There is, as far as I can see, no way to start insert mode silently (:silent startinsert doesn't work).

silent_mode is set with -s, from vim(1):

   -s          Silent  mode.   Only  when started as "Ex" or when the "-e"
               option was given before the "-s" option.

But as the help message says, this only works when using Vim as ex, and not when using it as vim.

|improve this answer|||||
4

You could simply :set noro before doing the modification. This should prevent the warning.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.