nvim.1 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. .Dd December 17, 2017
  2. .Dt NVIM 1
  3. .Os
  4. .Sh NAME
  5. .Nm nvim
  6. .Nd edit text
  7. .Sh SYNOPSIS
  8. .Nm
  9. .Op Ar options
  10. .Op Ar file ...
  11. .Nm
  12. .Op Ar options
  13. .Fl
  14. .Nm
  15. .Op Ar options
  16. .Fl t Ar tag
  17. .Nm
  18. .Op Ar options
  19. .Fl q Op Ar errorfile
  20. .Sh DESCRIPTION
  21. .Nm
  22. is a text editor based on Vim.
  23. Start
  24. .Nm
  25. followed by any number of options and/or files:
  26. .Pp
  27. .Dl nvim [options] [file ...]
  28. .Pp
  29. Commands in
  30. .Nm
  31. begin with colon
  32. .Pq Sq \&: .
  33. Type ":help subject" to get help on a specific subject.
  34. Use <Tab> and CTRL-D to complete subjects (":help cmdline\-completion").
  35. .Pp
  36. The "quickref" help section is a condensed reference of editor features:
  37. .Dl :help quickref
  38. .Pp
  39. If you are new to Vim/Nvim, start with the 30-minute tutorial:
  40. .Dl :Tutor
  41. .Pp
  42. After installing/updating Nvim, it's a good idea to run the self-check:
  43. .Dl :checkhealth
  44. .Pp
  45. .Bl -tag -width Fl
  46. .It Ar file ...
  47. File(s) to edit.
  48. Opens one buffer per file.
  49. To switch between buffers, use the
  50. .Ic :next
  51. and
  52. .Ic :previous
  53. commands.
  54. .It Fl
  55. Reads text from standard input until
  56. .Dv EOF ,
  57. then opens a buffer with that text.
  58. User input is read from standard error, which should be a terminal.
  59. .El
  60. .Sh OPTIONS
  61. .Bl -tag -width Fl
  62. .It Fl t Ar tag
  63. Finds
  64. .Ar tag
  65. in the tags file, the associated file becomes the current
  66. file and the associated command is executed.
  67. Cursor is positioned at the tag location in the file.
  68. .Ic ":help tag-commands"
  69. .It Fl q Op Ar errorfile
  70. QuickFix mode.
  71. Display the first error in
  72. .Ar errorfile .
  73. If
  74. .Ar errorfile
  75. is omitted, the value of the 'errorfile' option is used (defaults to
  76. .Cm errors.err ) .
  77. Further errors can be jumped to with the
  78. .Ic :cnext
  79. command.
  80. .Ic ":help quickfix"
  81. .It Fl -
  82. End of options.
  83. Remaining arguments are treated as literal file names, including filenames starting with hyphen
  84. .Pq Sq - .
  85. .It Fl e
  86. Ex mode, reading stdin as Ex commands.
  87. .Ic ":help Ex-mode"
  88. .It Fl E
  89. Ex mode, reading stdin as text.
  90. .Ic :help Ex-mode
  91. .It Fl es
  92. Silent (non-interactive) Ex mode, reading stdin as Ex commands.
  93. Useful for scripting because it does NOT start a UI, unlike
  94. .Fl e .
  95. .Ic :help silent-mode
  96. .It Fl \&Es
  97. Silent (non-interactive) Ex mode, reading stdin as text.
  98. Useful for scripting because it does NOT start a UI, unlike
  99. .Fl E .
  100. .Ic :help silent-mode
  101. .It Fl d
  102. Diff mode.
  103. Show the difference between two to four files, similar to
  104. .Xr sdiff 1 .
  105. .Ic ":help diff"
  106. .It Fl R
  107. Read-only mode.
  108. Sets the 'readonly' option.
  109. Implies
  110. .Fl n .
  111. Buffers can still be edited, but cannot be written to disk if already
  112. associated with a file.
  113. To overwrite a file, add an exclamation mark to the relevant Ex command, such as
  114. .Ic :w! .
  115. .Ic ":help 'readonly'"
  116. .It Fl Z
  117. Restricted mode.
  118. Disable commands that make use of an external shell.
  119. .It Fl m
  120. Resets the 'write' option, to disable file modifications.
  121. Writing to a file is disabled, but buffers can still be modified.
  122. .It Fl M
  123. Resets the 'write' and 'modifiable' options, to disable file and buffer
  124. modifications.
  125. .It Fl b
  126. Binary mode.
  127. .Ic ":help edit-binary"
  128. .It Fl l
  129. Lisp mode.
  130. Sets the 'lisp' and 'showmatch' options.
  131. .It Fl A
  132. Arabic mode.
  133. Sets the 'arabic' option.
  134. .It Fl H
  135. Hebrew mode.
  136. Sets the 'hkmap' and 'rightleft' options.
  137. .It Fl V Ns Oo Ar N Oc Ns Op Ar file
  138. Verbose mode.
  139. Prints debug messages.
  140. .Ar N
  141. is the 'verbose' level, defaults to
  142. .Cm 10 .
  143. If
  144. .Ar file
  145. is specified, append messages to
  146. .Ar file
  147. instead of printing them.
  148. .Ic ":help 'verbose'"
  149. .It Fl D
  150. Debug mode for VimL (Vim script).
  151. Started when executing the first command from a script.
  152. :help debug-mode
  153. .It Fl n
  154. Disable the use of swap files.
  155. Sets the 'updatecount' option to
  156. .Cm 0 .
  157. Can be useful for editing files on a slow medium.
  158. .It Fl r Op Ar file
  159. Recovery mode.
  160. If
  161. .Ar file
  162. is omitted
  163. then list swap files with recovery information.
  164. Otherwise the swap file
  165. .Ar file
  166. is used to recover a crashed session.
  167. The swap file has the same name as the file it's associated with, but with
  168. .Sq .swp
  169. appended.
  170. .Ic ":help recovery"
  171. .It Fl L Op Ar file
  172. Alias for
  173. .Fl r .
  174. .It Fl u Ar vimrc
  175. Use
  176. .Ar vimrc
  177. instead of the default
  178. .Pa ~/.config/nvim/init.vim .
  179. If
  180. .Ar vimrc
  181. is
  182. .Cm NORC ,
  183. do not load any initialization files (except plugins),
  184. and do not attempt to parse environment variables.
  185. If
  186. .Ar vimrc
  187. is
  188. .Cm NONE ,
  189. loading plugins is also skipped.
  190. .Ic ":help initialization"
  191. .It Fl i Ar shada
  192. Use
  193. .Ar shada
  194. instead of the default
  195. .Pa ~/.local/share/nvim/shada/main.shada .
  196. If
  197. .Ar shada
  198. is
  199. .Cm NONE ,
  200. do not read or write a ShaDa file.
  201. .Ic ":help shada"
  202. .It Fl -noplugin
  203. Skip loading plugins.
  204. Implied by
  205. .Cm -u NONE .
  206. .It Fl -clean
  207. Skip loading plugins and shada (viminfo) file.
  208. .It Fl o Ns Op Ar N
  209. Open
  210. .Ar N
  211. windows stacked horizontally.
  212. If
  213. .Ar N
  214. is omitted, open one window for each file.
  215. If
  216. .Ar N
  217. is less than the number of file arguments, allocate windows for the first
  218. .Ar N
  219. files and hide the rest.
  220. .It Fl O Ns Op Ar N
  221. Like
  222. .Fl o ,
  223. but tile windows vertically.
  224. .It Fl p Ns Op Ar N
  225. Like
  226. .Fl o ,
  227. but for tab pages.
  228. .It Cm + Ns Op Ar linenum
  229. For the first file, position the cursor on line
  230. .Ar linenum .
  231. If
  232. .Ar linenum
  233. is omitted, position the cursor on the last line of the file.
  234. .Cm +5
  235. and
  236. .Cm -c 5
  237. on the command-line are equivalent to
  238. .Ic :5
  239. inside
  240. .Nm .
  241. .It Cm +/ Ns Op Ar pattern
  242. For the first file, position the cursor on the first occurrence of
  243. .Ar pattern .
  244. If
  245. .Ar pattern
  246. is omitted, the most recent search pattern is used (if any).
  247. .Cm +/foo
  248. and
  249. .Cm -c /foo
  250. on the command-line are equivalent to
  251. .Ic /foo
  252. and
  253. .Ic :/foo
  254. inside
  255. .Nm .
  256. .Ic ":help search-pattern"
  257. .It \fB\+\fR\fI\,command\/\fR , Fl c Ar command
  258. Execute
  259. .Ar command
  260. after reading the first file.
  261. Up to 10 instances allowed.
  262. .Qq Cm +foo
  263. and
  264. .Cm -c \(dqfoo\(dq
  265. are equivalent.
  266. .It Fl -cmd Ar command
  267. Like
  268. .Fl c ,
  269. but execute
  270. .Ar command
  271. before processing any vimrc.
  272. Up to 10 instances of these can be used independently from instances of
  273. .Fl c .
  274. .It Fl S Op Ar session
  275. Source
  276. .Ar session
  277. after the first file argument has been read.
  278. Equivalent to
  279. .Cm -c \(dqsource session\(dq .
  280. .Ar session
  281. cannot start with a hyphen
  282. .Pq Sq - .
  283. If
  284. .Ar session
  285. is omitted then
  286. .Pa Session.vim
  287. is used, if found.
  288. .Ic ":help session-file"
  289. .It Fl s Ar scriptin
  290. Read normal mode commands from
  291. .Ar scriptin .
  292. The same can be done with the command
  293. .Ic ":source! scriptin" .
  294. If the end of the file is reached before
  295. .Nm
  296. exits, further characters are read from the keyboard.
  297. .It Fl w Ar scriptout
  298. Append all typed characters to
  299. .Ar scriptout .
  300. Can be used for creating a script to be used with
  301. .Fl s
  302. or
  303. .Ic :source! .
  304. .It Fl W Ar scriptout
  305. Like
  306. .Fl w ,
  307. but truncate
  308. .Ar scriptout .
  309. .It Fl -startuptime Ar file
  310. During startup, append timing messages to
  311. .Ar file .
  312. Can be used to diagnose slow startup times.
  313. .It Fl -api-info
  314. Dump API metadata serialized to msgpack and exit.
  315. .It Fl -embed
  316. Use standard input and standard output as a msgpack-rpc channel.
  317. :help --embed
  318. .It Fl -headless
  319. Do not start a UI.
  320. When supplied with --embed this implies that the embedding application does not intend to (immediately) start a UI.
  321. Also useful for "scraping" messages in a pipe.
  322. :help --headless
  323. .It Fl -listen Ar address
  324. Start RPC server on this pipe or TCP socket.
  325. .It Fl h , -help
  326. Print usage information and exit.
  327. .It Fl v , -version
  328. Print version information and exit.
  329. .El
  330. .Sh ENVIRONMENT
  331. .Bl -tag -width Fl
  332. .It Ev NVIM_LOG_FILE
  333. Low-level log file, usually found at ~/.local/share/nvim/log.
  334. :help $NVIM_LOG_FILE
  335. .It Ev VIM
  336. Used to locate user files, such as init.vim.
  337. System-dependent.
  338. :help $VIM
  339. .It Ev VIMRUNTIME
  340. Used to locate runtime files (documentation, syntax highlighting, etc.).
  341. .It Ev XDG_CONFIG_HOME
  342. Path to the user-local configuration directory, see
  343. .Sx FILES .
  344. Defaults to
  345. .Pa ~/.config .
  346. :help xdg
  347. .It Ev XDG_DATA_HOME
  348. Like
  349. .Ev XDG_CONFIG_HOME ,
  350. but used to store data not generally edited by the user,
  351. namely swap, backup, and ShaDa files.
  352. Defaults to
  353. .Pa ~/.local/share .
  354. :help xdg
  355. .It Ev VIMINIT
  356. Ex commands to be executed at startup.
  357. .Ic ":help VIMINIT"
  358. .It Ev SHELL
  359. Used to initialize the 'shell' option, which decides the default shell used by
  360. features like
  361. .Ic :terminal ,
  362. .Ic :! , and
  363. .Ic system() .
  364. .El
  365. .Sh FILES
  366. .Bl -tag -width "~/.config/nvim/init.vim"
  367. .It Pa ~/.config/nvim/init.vim
  368. User-local
  369. .Nm
  370. configuration file.
  371. .It Pa ~/.config/nvim
  372. User-local
  373. .Nm
  374. configuration directory.
  375. See also
  376. .Ev XDG_CONFIG_HOME .
  377. .It Pa $VIM/sysinit.vim
  378. System-global
  379. .Nm
  380. configuration file.
  381. .It Pa /usr/local/share/nvim
  382. System-global
  383. .Nm
  384. runtime directory.
  385. .El
  386. .Sh AUTHORS
  387. Nvim was started by
  388. .An Thiago de Arruda .
  389. Most of Vim was written by
  390. .An -nosplit
  391. .An Bram Moolenaar .
  392. Vim is based on Stevie, worked on by
  393. .An Tim Thompson ,
  394. .An Tony Andrews ,
  395. and
  396. .An G.R. (Fred) Walter .
  397. .Ic ":help credits"