Extended Attributes. It is an advanced way to save metadata
alongside the file in the filesystem. It depends on the actual filesystem
being used and Vim supports it only on a Linux system.
Vim attempts to preserve the extended attribute info when writing a file.
The backup file will get the extended attribute of the original file.
*read-only-share*
When MS-Windows shares a drive on the network it can be marked as read-only.
This means that even if the file read-only attribute is absent, and the ACL
settings on NT network shared drives allow writing to the file, you can still
not write to the file. Vim on Win32 platforms will detect read-only network
drives and will mark the file as read-only. You will not be able to override
it with |:write|.
*write-device*
When the file name is actually a device name, Vim will not make a backup (that
would be impossible). You need to use "!", since the device already exists.
Example for Unix: >
:w! /dev/lpt0
and MS-Windows: >
:w! lpt0
For Unix a device is detected when the name doesn't refer to a normal file or
a directory. A fifo or named pipe also looks like a device to Vim.
For MS-Windows the device is detected by its name:
CON
CLOCK$
NUL
PRN
COMn n=1,2,3... etc
LPTn n=1,2,3... etc
The names can be in upper- or lowercase.
==============================================================================
5. Writing and quitting *write-quit*
*:q* *:quit*
:q[uit] Quit the current window. Quit Vim if this is the last
|edit-window|. This fails when changes have been made
and Vim refuses to |abandon| the current buffer, and
when the last file in the argument list has not been
edited.
If there are other tab pages and quitting the last
window in the current tab page the current tab page is
closed |tab-page|.
Triggers the |QuitPre| autocommand event.
See |CTRL-W_q| for quitting another window.
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
the last file in the argument list has not been
edited. See |:confirm| and 'confirm'.
:q[uit]! Quit without writing, also when the current buffer has
changes. The buffer is unloaded, also when it has
'hidden' set.
If this is the last window and there is a modified
hidden buffer, the current buffer is abandoned and the
first changed hidden buffer becomes the current
buffer.
Use ":qall!" to exit always.
:cq[uit] Quit always, without writing, and return an error
code. See |:cq|.
*:wq*
:wq [++opt] Write the current file and close the window. If this
was the last |edit-window| Vim quits.
Writing fails when the file is read-only or the buffer
does not have a name. Quitting fails when the last
file in the argument list has not been edited.
:wq! [++opt] Write the current file and close the window. If this
was the last |edit-window| Vim quits. Writing fails
when the current buffer does not have a name.
:wq [++opt] {file} Write to {file} and close the window. If this was the
last |edit-window| Vim quits. Quitting fails when the
last file in the argument list has not been edited.
:wq! [++opt] {file} Write to {file} and close the current window. Quit
Vim if this was the last |edit-window|.
:[range]wq[!] [++opt] [file]
Same as above, but only write the lines in [range].
*:x* *:xit*
:[range]x[it][!] [++opt] [file]
Like ":wq", but write only when changes have been
made.
When 'hidden' is set and there are more windows, the
current buffer becomes hidden, after writing the file.
*:exi* *:exit*
:[range]exi[t][!] [++opt] [file]
Same as :xit.
*ZZ*
ZZ Write current file, if modified, and close the current
window (same as ":x").
If there are several windows for the current file,
only the current window is closed.
*ZQ*
ZQ Quit without checking for changes (same as ":q!").
MULTIPLE WINDOWS AND BUFFERS *window-exit*
*:qa* *:qall*
:qa[ll]