Home Explore Blog CI



neovim

9th chunk of `runtime/doc/editing.txt`
d54b97df073fd96ba2c3c3aa30d505536fc935bee085369b0000000100000fa0
 automatically when reading the
file and are used when writing the text to a file.  While editing the buffer
it looks like every line has a line ending and the CTRL-Z isn't there (an
exception is when 'binary' is set, it works differently then).

The 'fixendofline' option can be used to choose what to write.  You can also
change the option values to write the file differently than how it was read.

Here are some examples how to use them.

If you want files in Unix format (every line NL terminated): >
	setl ff=unix fixeol
You should probably do this on any Unix-like system.  Also modern MS-Windows
systems tend to work well with this.  It is recommended to always use this
format for Vim scripts.

If you want to use an old MS-DOS file in a modern environment, fixing line
endings and dropping CTRL-Z, but keeping the <CR><NL> style <EOL>: >
	setl ff=dos fixeol
This is useful for many MS-Windows programs, they regularly expect the
<CR><NL> line endings.

If you want to drop the final <EOL> and add a final CTRL-Z (e.g. for an old
system like CP/M): >
	setl ff=dos nofixeol noeol eof

If you want to preserve the fileformat exactly as-is, including any final
<EOL> and final CTRL-Z: >
	setl nofixeol

==============================================================================
3. The argument list				*argument-list* *arglist*

If you give more than one file name when starting Vim, this list is remembered
as the argument list.  You can jump to each file in this list.

Do not confuse this with the buffer list, which you can see with the
|:buffers| command.  The argument list was already present in Vi, the buffer
list is new in Vim.  Every file name in the argument list will also be present
in the buffer list (unless it was deleted with |:bdel| or |:bwipe|).  But it's
common that names in the buffer list are not in the argument list.

This subject is introduced in section |07.2| of the user manual.

There is one global argument list, which is used for all windows by default.
It is possible to create a new argument list local to a window, see
|:arglocal|.

You can use the argument list with the following commands, and with the
expression functions |argc()| and |argv()|.  These all work on the argument
list of the current window.

							*:ar* *:arg* *:args*
:ar[gs]			Print the argument list, with the current file in
			square brackets.

:ar[gs] [++opt] [+cmd] {arglist}			*:args_f*
			Define {arglist} as the new argument list and edit
			the first one.  This fails when changes have been made
			and Vim does not want to |abandon| the current buffer.
			Also see |++opt| and |+cmd|.

:ar[gs]! [++opt] [+cmd] {arglist}			*:args_f!*
			Define {arglist} as the new argument list and edit
			the first one.  Discard any changes to the current
			buffer.
			Also see |++opt| and |+cmd|.

:[count]arge[dit][!] [++opt] [+cmd] {name} ..		*:arge* *:argedit*
			Add {name}s to the argument list and edit it.
			There is no check for duplicates, it is possible to
			add a file to the argument list twice |:argded|.
			This is like using |:argadd| and then |:edit| (with
			the small exception that |:edit| does not change the
			argument list, so the argument list pointer isn't
			changed).
			Spaces in filenames have to be escaped with "\".
			[count] is used like with |:argadd|.
			If the current file cannot be |abandon|ed {name}s will
			still be added to the argument list, but won't be
			edited. No check for duplicates is done.
			Also see |++opt| and |+cmd|.

:[count]arga[dd] {name} ..			*:arga* *:argadd* *E479*
:[count]arga[dd]						*E1156*
			Add the {name}s to the argument list.  When {name} is
			omitted add the current buffer name to the argument
			list.
			If [count] is omitted, the {name}s are added just
			after the current entry in the argument list.
			Otherwise they are added after the [count]'th file.
			If the argument list is "a b c", and "b" is the
			current argument, then these commands result in:
				command		new argument list ~
				:argadd

Title: Controlling File Formats and the Argument List in Vim
Summary
This section details how to precisely control file formats in Vim, including line endings (EOL) and the end-of-file (EOF) character (CTRL-Z), using options like 'fileformat', 'fixendofline', 'endofline', and 'endoffile'. It provides examples for different scenarios, such as Unix-style line endings, preserving old MS-DOS formats, or adding a CTRL-Z at the end of a file. It then transitions to explaining the 'argument list' in Vim, a list of files specified when starting Vim, distinct from the buffer list. It describes commands like `:args`, `:argadd`, and `:argedit` for manipulating the argument list, along with related functions.