diff options
author | Louis Sven Goulet <31444858+lorlouis@users.noreply.github.com> | 2022-09-24 21:57:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-24 18:57:10 -0700 |
commit | 2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2 (patch) | |
tree | e108192c095f418f5f2255468e3a4d570119eb00 /runtime | |
parent | c7cf1232a71b0db700b818e2ae8e8ebaf40133f2 (diff) | |
download | rneovim-2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2.tar.gz rneovim-2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2.tar.bz2 rneovim-2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2.zip |
feat: ":write!" skips "file changed" warning #18665
Problem:
Cannot opt-out of "WARNING: The file has been changed since reading
it!!!", even with ":write!".
Solution:
Change ":write!" to skip the warning.
closes #7270
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/editing.txt | 6 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index dcb0bf8a2e..21a30ca429 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -941,7 +941,7 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write* Vim will warn you if you try to overwrite a file that has been changed -elsewhere. See |timestamp|. +elsewhere (unless "!" was used). See |timestamp|. *backup* *E207* *E506* *E507* *E508* *E509* *E510* If you write to an existing file (but do not append) while the 'backup', @@ -1481,8 +1481,8 @@ doing something there and closing it should be OK (if there are no side effects from other autocommands). Closing unrelated windows and buffers will get you into trouble. -Before writing a file the timestamp is checked. If it has changed, Vim will -ask if you really want to overwrite the file: +Before writing a file, the timestamp is checked (unless "!" was used). +If it has changed, Vim will ask if you really want to overwrite the file: WARNING: The file has been changed since reading it!!! Do you really want to write to it (y/n)? diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index b013e00fe8..e254e5edd0 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -372,6 +372,7 @@ Lua interface (|lua.txt|): Commands: |:doautocmd| does not warn about "No matching autocommands". |:wincmd| accepts a count. + `:write!` does not show a prompt if the file was updated externally. Command line completion: The meanings of arrow keys do not change depending on 'wildoptions'. |