Wednesday, November 11, 2020

Re: W16: Warning: Mode of file has changed

Elijah wrote:

> Help has this to say:
>
> *W16*
> Warning: Mode of file "{filename}" has changed since editing started
>
> When the timestamp for a buffer was changed and the contents are still the
> same but the mode (permissions) have changed. This usually occurs when
> checking out a file from a version control system, which causes the read-only
> bit to be reset. It should be safe to reload the file. Set 'autoread' to
> automatically reload the file.
>
> Is there a fix besides set autoread? In my usage, 100% of the time I get
> this warning when I run a command like
>
> :! chmod 755 %
>
> I get that it is helpful to detect for some usecases, but I'd like this
> to just be silenced and ignored all of the time. I'm hoping there is
> some vim setting I don't know about which will take a list of
> warnings to not warn about.

You can use the FileChangedShell autocommand and check that v:fcs_reason
is equal to "mode". Set v:fcs_choice to "ask" if not.

--
hundred-and-one symptoms of being an internet addict:
235. You start naming your kids Pascal, COBOL, Algol and Fortran.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202011112040.0ABKeH4l938588%40masaka.moolenaar.net.

No comments: