1NVIM(1) BSD General Commands Manual NVIM(1)
2
4 nvim — edit text
5
7 nvim [options] [file ...]
8 nvim [options] -
9 nvim [options] -t tag
10 nvim [options] -q [errorfile]
11
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
32 between 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
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/batch mode, reading stdin as Ex commands. :help
58 silent-mode
59
60 -Es Silent/batch mode, reading stdin as text. :help silent-mode
61
62 -d Diff mode. Show the difference between two to four files,
63 similar to sdiff(1). :help diff
64
65 -R Read-only mode. Sets the 'readonly' option. Implies -n.
66 Buffers can still be edited, but cannot be written to disk if
67 already associated with a file. To overwrite a file, add an
68 exclamation mark to the relevant Ex command, such as :w!.
69 :help 'readonly'
70
71 -Z Restricted mode. Disable commands that make use of an exter‐
72 nal shell.
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 -l Lisp mode. Sets the 'lisp' and 'showmatch' options.
84
85 -A Arabic mode. Sets the 'arabic' option.
86
87 -H Hebrew mode. Sets the 'hkmap' and 'rightleft' options.
88
89 -V[N][file]
90 Verbose mode. Prints debug messages. N is the 'verbose'
91 level, defaults to 10. If file is specified, append messages
92 to file instead of printing them. :help 'verbose'
93
94 -D Debug mode for VimL (Vim script). Started when executing the
95 first command from a script. :help debug-mode
96
97 -n Disable the use of swap files. Sets the 'updatecount' option
98 to 0. Can be useful for editing files on a slow medium.
99
100 -r [file] Recovery mode. If file is omitted then list swap files with
101 recovery information. Otherwise the swap file file is used
102 to recover a crashed session. The swap file has the same
103 name as the file it's associated with, but with ‘.swp’
104 appended. :help recovery
105
106 -L [file] Alias for -r.
107
108 -u vimrc Use vimrc instead of the default ~/.config/nvim/init.vim. If
109 vimrc is NORC, do not load any initialization files (except
110 plugins), and do not attempt to parse environment variables.
111 If vimrc is NONE, loading plugins is also skipped. :help
112 initialization
113
114 -i shada Use shada instead of the default
115 ~/.local/share/nvim/shada/main.shada. If shada is NONE, do
116 not read or write a ShaDa file. :help shada
117
118 --noplugin Skip loading plugins. Implied by -u NONE.
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
143 instances 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
148 instances of -c.
149
150 -S [session]
151 Source session after the first file argument has been read.
152 Equivalent to -c "source session". session cannot start with
153 a hyphen (‘-’). If session is omitted then Session.vim is
154 used, if found. :help session-file
155
156 -s scriptin
157 Read normal mode commands from scriptin. The same can be
158 done with the command :source! scriptin. If the end of the
159 file is reached before nvim exits, further characters are
160 read from the keyboard.
161
162 -w scriptout
163 Append all typed characters to scriptout. Can be used for
164 creating a script to be used with -s or :source!.
165
166 -W scriptout
167 Like -w, but truncate scriptout.
168
169 --startuptime file
170 During startup, append timing messages to file. Can be used
171 to diagnose slow startup times.
172
173 --api-info Dump API metadata serialized to msgpack and exit.
174
175 --embed Use standard input and standard output as a msgpack-rpc chan‐
176 nel. :help --embed
177
178 --headless Do not start a UI. When supplied with --embed this implies
179 that the embedding application does not intend to (immedi‐
180 ately) start a UI. Also useful for "scraping" messages in a
181 pipe. :help --headless
182
183 --listen address
184 Start RPC server on this pipe or TCP socket.
185
186 -h, --help Print usage information and exit.
187
188 -v, --version
189 Print version information and exit.
190
192 NVIM_LOG_FILE
193 Low-level log file, usually found at ~/.local/share/nvim/log.
194 :help $NVIM_LOG_FILE
195
196 VIM Used to locate user files, such as init.vim. System-depen‐
197 dent. :help $VIM
198
199 VIMRUNTIME Used to locate runtime files (documentation, syntax high‐
200 lighting, etc.).
201
202 XDG_CONFIG_HOME
203 Path to the user-local configuration directory, see FILES.
204 Defaults to ~/.config. :help xdg
205
206 XDG_DATA_HOME
207 Like XDG_CONFIG_HOME, but used to store data not generally
208 edited by the user, namely swap, backup, and ShaDa files.
209 Defaults to ~/.local/share. :help xdg
210
211 VIMINIT Ex commands to be executed at startup. :help VIMINIT
212
213 SHELL Used to initialize the 'shell' option, which decides the
214 default shell used by features like :terminal, :!, and
215 system().
216
218 ~/.config/nvim/init.vim User-local nvim configuration file.
219
220 ~/.config/nvim User-local nvim configuration directory. See
221 also XDG_CONFIG_HOME.
222
223 $VIM/sysinit.vim System-global nvim configuration file.
224
225 /usr/local/share/nvim System-global nvim runtime directory.
226
228 Nvim was started by Thiago de Arruda. Most of Vim was written by Bram
229 Moolenaar. Vim is based on Stevie, worked on by Tim Thompson, Tony
230 Andrews, and G.R. (Fred) Walter. :help credits
231
232BSD December 17, 2017 BSD