File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- *editing.txt* For Vim version 9.1. Last change: 2024 Oct 13
1+ *editing.txt* For Vim version 9.1. Last change: 2024 Oct 14
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1058,6 +1058,15 @@ explanation of when the copy is made and when the file is renamed.
10581058If the creation of a backup file fails, the write is not done. If you want
10591059to write anyway add a '!' to the command.
10601060
1061+ *file-watcher*
1062+ When you notice issues with programs, that act upon when a buffer is written
1063+ (like inotify, entr or fswatch) or when external applications execute Vim to
1064+ edit the file (like git) and those programs do not seem to notice that the
1065+ original file has been changed, you may want to consider switching the
1066+ 'backupcopy' option value to "yes". This makes sure, Vim writes to the same
1067+ file, that those watcher programs expect, without creating a new file (which
1068+ prevents them from detecting that the file has changed). See also | crontab |
1069+
10611070 *write-permissions*
10621071When writing a new file the permissions are read-write. For unix the mask is
106310720o666 with additionally umask applied. When writing a file that was read Vim
Original file line number Diff line number Diff line change @@ -1151,12 +1151,13 @@ A jump table for the options with a short description can be found at |Q_op|.
11511151 useful for example in source trees where all the files are symbolic or
11521152 hard links and any changes should stay in the local source tree, not
11531153 be propagated back to the original source.
1154- *crontab*
1154+ *crontab*
11551155 One situation where "no" and "auto" will cause problems: A program
11561156 that opens a file, invokes Vim to edit that file, and then tests if
11571157 the open file was changed (through the file descriptor) will check the
11581158 backup file instead of the newly created file. "crontab -e" is an
1159- example.
1159+ example, as are several | file-watcher | daemons like inotify. In that
1160+ case you probably want to switch this option.
11601161
11611162 When a copy is made, the original file is truncated and then filled
11621163 with the new text. This means that protection bits, owner and
Original file line number Diff line number Diff line change @@ -7114,6 +7114,7 @@ file-read insert.txt /*file-read*
71147114file-searching editing.txt /*file-searching*
71157115file-type filetype.txt /*file-type*
71167116file-types filetype.txt /*file-types*
7117+ file-watcher editing.txt /*file-watcher*
71177118file_readable() builtin.txt /*file_readable()*
71187119filecopy() builtin.txt /*filecopy()*
71197120fileencoding-changed version6.txt /*fileencoding-changed*
You can’t perform that action at this time.
0 commit comments