It seems that by default in neovim, if a file changes on disk, neovim reloads the file from disk. This is different from vim, which requires you to do something like :e!
to reload the file.
Though I can see why one might sometimes want the automatic file watching behavior, I don’t want it by default. (For me, it’s dangerous.) How can I turn this off?
I think this is probably common question, but I haven’t found the answer. I searched for “watch” and “reload” in the help system, in the FAQ, in the online version of the help system (both via :help <term>
and by simply searching in the main help file), in vim.stackexchange with the [nvim]
tag, and I read through nvim-from-vim again. The answer is probably somewhere in one of these sources, but I have been unsuccessful in finding it. (:help watch
does bring up a location in lua.txt that explains how to write a file-watcher.) Some things are difficult to search for effectively.
I’m also not sure whether this is the place to ask this kind of very basic question. Please let me if I should be asking somewhere else.