Home Explore Blog CI



neovim

1st chunk of `runtime/doc/starting.txt`
6b2087ee90b661694a4f1e14b4110e83f2d091b56a1a97ba0000000100000fa9
*starting.txt*  Nvim


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Starting Vim						*starting*

                                      Type |gO| to see the table of contents.

==============================================================================
Nvim arguments						*cli-arguments*

Most often, Nvim is started to edit a single file with the command: >

	nvim filename

More generally, Nvim is started with: >

	nvim [option | filename] ..

Option arguments and file name arguments can be mixed, and any number of them
can be given.  However, watch out for options that take an argument.

The following items decide how to start editing:

							*-file* *---*
filename	One or more file names.  The first one will be the current
		file and read into the buffer.  The cursor will be positioned
		on the first line of the buffer.
		To avoid a file name starting with a '-' being interpreted as
		an option, precede the arglist with "--", e.g.: >
			nvim -- -filename
<		All arguments after "--" are interpreted as file names, no
		other options or "+command" arguments can follow.

							*--*
`-`		Alias for stdin (standard input).
		Example: >
			echo text | nvim - file
<		"text" is read into buffer 1, "file" is opened as buffer 2.
		In most cases (except -s, -es, |--embed|, --headless) if stdin
		is not a TTY then it is read as text, so "-" is implied: >
			echo text | nvim file
<		The buffer will be marked as modified, because it contains
		text that needs to be saved (except for readonly |-R| mode).
		If you don't like that, put these lines in your init.vim: >
			" Don't set 'modified' when reading from stdin
			au StdinReadPost * set nomodified
<
		To read stdin as Normal commands use |-s| with "-": >
			echo "ifoo" | nvim -s -
<		To read stdin as Ex commands use |-es| or |-e|: >
			echo "echo getpid()" | nvim -e - -V1
<		To open a file literally named "-", put it after "--": >
			echo foo | nvim -- -
<		To read stdin as text with |--headless| use "-".

							*-t* *-tag*
-t {tag}	A tag.  "tag" is looked up in the tags file, the associated
		file becomes the current file, and the associated command is
		executed.  Mostly this is used for C programs, in which case
		"tag" often is a function name.  The effect is that the file
		containing that function becomes the current file and the
		cursor is positioned on the start of the function (see
		|tags|).

							*-q* *-qf*
-q [errorfile]	QuickFix mode.  The file with the name [errorfile] is read
		and the first error is displayed.  See |quickfix|.
		If [errorfile] is not given, the 'errorfile' option is used
		for the file name.  See 'errorfile' for the default value.

(nothing)	Without one of the four items above, Vim will start editing a
		new buffer.  It's empty and doesn't have a file name.

							*startup-options*
The option arguments may be given in any order.  Single-letter options can be
combined after one dash.  There can be no option arguments after the "--"
argument.

--help							*-h* *--help* *-?*
-?
-h		Give usage (help) message and exit.

--version						*-v* *--version*
-v		Print version information and exit.  Same output as for
		|:version| command.

							*--clean*
--clean		Mimics a fresh install of Nvim:
		- Skips initializations from files and environment variables.
		- No 'shada' file is read or written.
		- Excludes user directories from 'runtimepath'
		- Loads builtin plugins, unlike "-u NONE -i NONE".

							*--noplugin*
--noplugin	Skip loading plugins.  Resets the 'loadplugins' option.
		Note that the |-u| argument may also disable loading plugins:
			argument	load vimrc files	load plugins ~
			(nothing)		yes		    yes
			-u NONE			no		    no
			-u NORC			no		    yes
			--noplugin		yes		    no

--startuptime {fname}					*--startuptime*
		During startup write timing messages to the file {fname}.
		This can be used to find out where time is spent while loading
		your |config|, plugins and opening the first file.
		When {fname} already exists new messages are appended.

Title: Nvim Arguments and Startup Options
Summary
This section describes how to start Nvim from the command line, including options for specifying files to edit, using tags, quickfix mode, and various startup options like displaying help, version information, skipping plugins, and measuring startup time. It also explains how Nvim handles stdin and the '--' argument for treating subsequent arguments as filenames.