How do I disable auto updating of a modified file? When I have a file open read-only, if the file is modified in another nvim instance, the read-only file is automatically updated. How do I disable that entirely and without warning?
The indentation design in vim is extraordinarily stupid, I have no idea whatās going on half of the time. Try adding filetype plugin off in your init.vim.
As for the second question: Iām not sure if thatās even possible since the readonly property is only valid for a single buffer. This is a bit of a weird usecase if Iām being honest, couldnāt you open a new, empty buffer and just copy the text there?
For the first question, these are all different indentation strategies, and thereās no single āindent offā option. What I expect is happening (and @dundargoc already alluded to) is that a filetype plugin is setting them, overriding what you put in your init.vim. filetype plugin off (or just nvim -u NONE) is a good way to check whether that is the case; but itās not a good fix in general. If itās only one filetype, you can override the plugin by putting the command in .config/nvim/after/ftplugin/<filetype>.vim.
For the second (unrelated!) question, look at :h 'autoread'.
Unfortunately no progress with either issue. Setting the following in ~/.config/nvim/init.vim:
filetype indent off
set noautoread
The filetype indent off has no effect. Just to be clear, when I type āoā to open a new line below, the cursor becomes positioned indented. Should I be setting this in combination with other autoindent settings?
The set noautoread does stop it from auto-reading. However instead I now get a warning at the bottom of the page:
W11: Warning: File "setup/ConsoleMenu.java" has changed since e...
See ":help W11" for more info.
[O]K, (L)oad File:
Ironically this warning is why I sought out nvim in the first place.
As for the use case, I will explain:
As a software developer, I frequently want to view the original unmodified file while Iām simultaneously modify it in another terminal. This is a sort of before and after comparison.
I donāt want syntax highlighting. I donāt want it to warn me that a file that I have open read-only has been modified elsewhere (which doesnāt even make sense to me since itās open read-only). I donāt want it to autoread files. I donāt want it to autoindent lines. I donāt want it to āautoā anything. Is there was a version of vi that was just absolutely minimal. I want vi like it was in 1996 before George Lucas added CGI scenes to Star Wars.
Iām dumb. I meant to write filetype indent off, notfiletype plugin off. Note: this has to be set in your init.vim, doesnāt work on the command line.