1NVIM(1)                   BSD General Commands Manual                  NVIM(1)
2

NAME

4     nvim — edit text
5

SYNOPSIS

7     nvim [options] [file ...]
8     nvim [options] -
9     nvim [options] -t tag
10     nvim [options] -q [errorfile]
11

DESCRIPTION

13     nvim is a text editor based on Vim.  Start nvim followed by any number of
14     options and/or files:
15
16           nvim [options] [file ...]
17
18     Commands in nvim begin with colon (‘:’).  Type ":help subject" to get
19     help on a specific subject.  Use <Tab> and CTRL-D to complete subjects
20     (":help cmdline-completion").
21
22     The "quickref" help section is a condensed reference of editor features:
23           :help quickref
24
25     If you are new to Vim/Nvim, start with the 30-minute tutorial:
26           :Tutor
27
28     After installing/updating Nvim, it's a good idea to run the self-check:
29           :checkhealth
30
31     file ...    File(s) to edit.  Opens one buffer per file.  To switch be‐
32                 tween buffers, use the :next and :previous commands.
33
34     -           Reads text from standard input until EOF, then opens a buffer
35                 with that text.  User input is read from standard error,
36                 which should be a terminal.
37

OPTIONS

39     -t tag      Finds tag in the tags file, the associated file becomes the
40                 current file and the associated command is executed.  Cursor
41                 is positioned at the tag location in the file.  :help tag-
42                 commands
43
44     -q [errorfile]
45                 QuickFix mode.  Display the first error in errorfile.  If
46                 errorfile is omitted, the value of the 'errorfile' option is
47                 used (defaults to errors.err).  Further errors can be jumped
48                 to with the :cnext command.  :help quickfix
49
50     --          End of options.  Remaining arguments are treated as literal
51                 file names, including filenames starting with hyphen (‘-’).
52
53     -e          Ex mode, reading stdin as Ex commands.  :help Ex-mode
54
55     -E          Ex mode, reading stdin as text.  :help Ex-mode
56
57     -es         Silent (non-interactive) Ex mode, reading stdin as Ex com‐
58                 mands.  Useful for scripting because it does NOT start a UI,
59                 unlike -e.  :help silent-mode
60
61     -Es         Silent (non-interactive) Ex mode, reading stdin as text.
62                 Useful for scripting because it does NOT start a UI, unlike
63                 -E.  :help silent-mode
64
65     -d          Diff mode.  Show the difference between two to eight files,
66                 similar to sdiff(1).  :help diff
67
68     -R          Read-only mode.  Sets the 'readonly' option.  Implies -n.
69                 Buffers can still be edited, but cannot be written to disk if
70                 already associated with a file.  To overwrite a file, add an
71                 exclamation mark to the relevant Ex command, such as :w!.
72                 :help 'readonly'
73
74     -m          Resets the 'write' option, to disable file modifications.
75                 Writing to a file is disabled, but buffers can still be modi‐
76                 fied.
77
78     -M          Resets the 'write' and 'modifiable' options, to disable file
79                 and buffer modifications.
80
81     -b          Binary mode.  :help edit-binary
82
83     -A          Arabic mode.  Sets the 'arabic' option.
84
85     -H          Hebrew mode.  Sets the 'hkmap' and 'rightleft' options.
86
87     -V[N][file]
88                 Verbose mode.  Prints debug messages.  N is the 'verbose'
89                 level, defaults to 10.  If file is specified, append messages
90                 to file instead of printing them.  :help 'verbose'
91
92     -D          Vimscript debug mode.  Started when executing the first com‐
93                 mand from a script.  :help debug-mode
94
95     -n          Disable the use of swap files.  Sets the 'updatecount' option
96                 to 0.  Can be useful for editing files on a slow medium.
97
98     -r [file]   Recovery mode.  If file is omitted then list swap files with
99                 recovery information.  Otherwise the swap file file is used
100                 to recover a crashed session.  The swap file has the same
101                 name as the file it's associated with, but with ‘.swp’ ap‐
102                 pended.  :help recovery
103
104     -L [file]   Alias for -r.
105
106     -u vimrc    Use vimrc instead of the default ~/.config/nvim/init.vim.  If
107                 vimrc is NORC, do not load any initialization files (except
108                 plugins).  If vimrc is NONE, loading plugins is also skipped.
109                 :help initialization
110
111     -i shada    Use shada instead of the default
112                 ~/.local/state/nvim/shada/main.shada.  If shada is NONE, do
113                 not read or write a ShaDa file.  :help shada
114
115     --noplugin  Skip loading plugins.  Implied by -u NONE.
116
117     --clean     Start Nvim with "factory defaults" (no user config and plug‐
118                 ins, no shada).  :help --clean
119
120     -o[N]       Open N windows stacked horizontally.  If N is omitted, open
121                 one window for each file.  If N is less than the number of
122                 file arguments, allocate windows for the first N files and
123                 hide the rest.
124
125     -O[N]       Like -o, but tile windows vertically.
126
127     -p[N]       Like -o, but for tab pages.
128
129     +[linenum]  For the first file, position the cursor on line linenum.  If
130                 linenum is omitted, position the cursor on the last line of
131                 the file.  +5 and -c 5 on the command-line are equivalent to
132                 :5 inside nvim.
133
134     +/[pattern]
135                 For the first file, position the cursor on the first occur‐
136                 rence of pattern.  If pattern is omitted, the most recent
137                 search pattern is used (if any).  +/foo and -c /foo on the
138                 command-line are equivalent to /foo and :/foo inside nvim.
139                 :help search-pattern
140
141     +command, -c command
142                 Execute command after reading the first file.  Up to 10 in‐
143                 stances allowed.  "+foo" and -c "foo" are equivalent.
144
145     --cmd command
146                 Like -c, but execute command before processing any vimrc.  Up
147                 to 10 instances of these can be used independently from in‐
148                 stances of -c.
149
150     -l script [args]
151                 Execute Lua script with optional [args] after processing any
152                 preceding Nvim startup arguments.  All [args] are treated as
153                 script arguments and are passed literally to Lua, that is, -l
154                 stops processing of Nvim arguments.  :help -l
155
156     -S [session]
157                 Execute session after the first file argument has been read.
158                 If session filename ends with .lua it is executed as Lua in‐
159                 stead of Vimscript.  Equivalent to -c "source session".
160                 session cannot start with a hyphen (‘-’).  If session is
161                 omitted then Session.vim is used, if found.  :help session-
162                 file
163
164     -s scriptin
165                 Read normal mode commands from scriptin.  The same can be
166                 done with the command :source! scriptin.  If the end of the
167                 file is reached before nvim exits, further characters are
168                 read from the keyboard.
169
170     -w scriptout
171                 Append all typed characters to scriptout.  Can be used for
172                 creating a script to be used with -s or :source!.
173
174     -W scriptout
175                 Like -w, but truncate scriptout.
176
177     --startuptime file
178                 During startup, append timing messages to file.  Can be used
179                 to diagnose slow startup times.
180
181     --api-info  Dump API metadata serialized to msgpack and exit.
182
183     --embed     Use standard input and standard output as a msgpack-rpc chan‐
184                 nel.  :help --embed
185
186     --headless  Do not start a UI.  When supplied with --embed this implies
187                 that the embedding application does not intend to (immedi‐
188                 ately) start a UI.  Also useful for "scraping" messages in a
189                 pipe.  :help --headless
190
191     --listen address
192                 Start RPC server on this pipe or TCP socket.
193
194     -h, --help  Print usage information and exit.
195
196     -v, --version
197                 Print version information and exit.
198

ENVIRONMENT

200     NVIM_LOG_FILE
201                 Low-level log file, usually found at ~/.local/state/nvim/log.
202                 :help $NVIM_LOG_FILE
203
204     VIM         Used to locate user files, such as init.vim.  System-depen‐
205                 dent.  :help $VIM
206
207     VIMRUNTIME  Used to locate runtime files (documentation, syntax high‐
208                 lighting, etc.).
209
210     XDG_CONFIG_HOME
211                 Path to the user-local configuration directory, see FILES.
212                 Defaults to ~/.config.  :help xdg
213
214     XDG_STATE_HOME
215                 Like XDG_CONFIG_HOME, but used to store data not generally
216                 edited by the user, namely swap, backup, and ShaDa files.
217                 Defaults to ~/.local/state.  :help xdg
218
219     XDG_DATA_HOME
220                 Like XDG_CONFIG_HOME, but used to store data not generally
221                 edited by the user, things like runtime files.  Defaults to
222                 ~/.local/share.  :help xdg
223
224     VIMINIT     Ex commands to be executed at startup.  :help VIMINIT
225
226     SHELL       Used to initialize the 'shell' option, which decides the de‐
227                 fault shell used by features like :terminal, :!, and
228                 system().
229

FILES

231     ~/.config/nvim/init.vim  User-local nvim configuration file.
232
233     ~/.config/nvim           User-local nvim configuration directory.  See
234                              also XDG_CONFIG_HOME.
235
236     $VIM/sysinit.vim         System-global nvim configuration file.
237
238     $VIM                     System-global nvim runtime directory.
239

AUTHORS

241     Nvim was started by Thiago de Arruda.  Most of Vim was written by Bram
242     Moolenaar.  Vim is based on Stevie, worked on by Tim Thompson, Tony
243     Andrews, and G.R. (Fred) Walter.  :help credits
244
245BSD                            December 17, 2017                           BSD
Impressum