nvim.1 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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 m
  117. Resets the 'write' option, to disable file modifications.
  118. Writing to a file is disabled, but buffers can still be modified.
  119. .It Fl M
  120. Resets the 'write' and 'modifiable' options, to disable file and buffer
  121. modifications.
  122. .It Fl b
  123. Binary mode.
  124. .Ic ":help edit-binary"
  125. .It Fl l
  126. Lisp mode.
  127. Sets the 'lisp' and 'showmatch' options.
  128. .It Fl A
  129. Arabic mode.
  130. Sets the 'arabic' option.
  131. .It Fl H
  132. Hebrew mode.
  133. Sets the 'hkmap' and 'rightleft' options.
  134. .It Fl V Ns Oo Ar N Oc Ns Op Ar file
  135. Verbose mode.
  136. Prints debug messages.
  137. .Ar N
  138. is the 'verbose' level, defaults to
  139. .Cm 10 .
  140. If
  141. .Ar file
  142. is specified, append messages to
  143. .Ar file
  144. instead of printing them.
  145. .Ic ":help 'verbose'"
  146. .It Fl D
  147. Debug mode for VimL (Vim script).
  148. Started when executing the first command from a script.
  149. :help debug-mode
  150. .It Fl n
  151. Disable the use of swap files.
  152. Sets the 'updatecount' option to
  153. .Cm 0 .
  154. Can be useful for editing files on a slow medium.
  155. .It Fl r Op Ar file
  156. Recovery mode.
  157. If
  158. .Ar file
  159. is omitted
  160. then list swap files with recovery information.
  161. Otherwise the swap file
  162. .Ar file
  163. is used to recover a crashed session.
  164. The swap file has the same name as the file it's associated with, but with
  165. .Sq .swp
  166. appended.
  167. .Ic ":help recovery"
  168. .It Fl L Op Ar file
  169. Alias for
  170. .Fl r .
  171. .It Fl u Ar vimrc
  172. Use
  173. .Ar vimrc
  174. instead of the default
  175. .Pa ~/.config/nvim/init.vim .
  176. If
  177. .Ar vimrc
  178. is
  179. .Cm NORC ,
  180. do not load any initialization files (except plugins),
  181. and do not attempt to parse environment variables.
  182. If
  183. .Ar vimrc
  184. is
  185. .Cm NONE ,
  186. loading plugins is also skipped.
  187. .Ic ":help initialization"
  188. .It Fl i Ar shada
  189. Use
  190. .Ar shada
  191. instead of the default
  192. .Pa ~/.local/share/nvim/shada/main.shada .
  193. If
  194. .Ar shada
  195. is
  196. .Cm NONE ,
  197. do not read or write a ShaDa file.
  198. .Ic ":help shada"
  199. .It Fl -noplugin
  200. Skip loading plugins.
  201. Implied by
  202. .Cm -u NONE .
  203. .It Fl -clean
  204. Skip loading plugins and shada (viminfo) file.
  205. .It Fl o Ns Op Ar N
  206. Open
  207. .Ar N
  208. windows stacked horizontally.
  209. If
  210. .Ar N
  211. is omitted, open one window for each file.
  212. If
  213. .Ar N
  214. is less than the number of file arguments, allocate windows for the first
  215. .Ar N
  216. files and hide the rest.
  217. .It Fl O Ns Op Ar N
  218. Like
  219. .Fl o ,
  220. but tile windows vertically.
  221. .It Fl p Ns Op Ar N
  222. Like
  223. .Fl o ,
  224. but for tab pages.
  225. .It Cm + Ns Op Ar linenum
  226. For the first file, position the cursor on line
  227. .Ar linenum .
  228. If
  229. .Ar linenum
  230. is omitted, position the cursor on the last line of the file.
  231. .Cm +5
  232. and
  233. .Cm -c 5
  234. on the command-line are equivalent to
  235. .Ic :5
  236. inside
  237. .Nm .
  238. .It Cm +/ Ns Op Ar pattern
  239. For the first file, position the cursor on the first occurrence of
  240. .Ar pattern .
  241. If
  242. .Ar pattern
  243. is omitted, the most recent search pattern is used (if any).
  244. .Cm +/foo
  245. and
  246. .Cm -c /foo
  247. on the command-line are equivalent to
  248. .Ic /foo
  249. and
  250. .Ic :/foo
  251. inside
  252. .Nm .
  253. .Ic ":help search-pattern"
  254. .It \fB\+\fR\fI\,command\/\fR , Fl c Ar command
  255. Execute
  256. .Ar command
  257. after reading the first file.
  258. Up to 10 instances allowed.
  259. .Qq Cm +foo
  260. and
  261. .Cm -c \(dqfoo\(dq
  262. are equivalent.
  263. .It Fl -cmd Ar command
  264. Like
  265. .Fl c ,
  266. but execute
  267. .Ar command
  268. before processing any vimrc.
  269. Up to 10 instances of these can be used independently from instances of
  270. .Fl c .
  271. .It Fl S Op Ar session
  272. Source
  273. .Ar session
  274. after the first file argument has been read.
  275. Equivalent to
  276. .Cm -c \(dqsource session\(dq .
  277. .Ar session
  278. cannot start with a hyphen
  279. .Pq Sq - .
  280. If
  281. .Ar session
  282. is omitted then
  283. .Pa Session.vim
  284. is used, if found.
  285. .Ic ":help session-file"
  286. .It Fl s Ar scriptin
  287. Read normal mode commands from
  288. .Ar scriptin .
  289. The same can be done with the command
  290. .Ic ":source! scriptin" .
  291. If the end of the file is reached before
  292. .Nm
  293. exits, further characters are read from the keyboard.
  294. .It Fl w Ar scriptout
  295. Append all typed characters to
  296. .Ar scriptout .
  297. Can be used for creating a script to be used with
  298. .Fl s
  299. or
  300. .Ic :source! .
  301. .It Fl W Ar scriptout
  302. Like
  303. .Fl w ,
  304. but truncate
  305. .Ar scriptout .
  306. .It Fl -startuptime Ar file
  307. During startup, append timing messages to
  308. .Ar file .
  309. Can be used to diagnose slow startup times.
  310. .It Fl -api-info
  311. Dump API metadata serialized to msgpack and exit.
  312. .It Fl -embed
  313. Use standard input and standard output as a msgpack-rpc channel.
  314. :help --embed
  315. .It Fl -headless
  316. Do not start a UI.
  317. When supplied with --embed this implies that the embedding application does not intend to (immediately) start a UI.
  318. Also useful for "scraping" messages in a pipe.
  319. :help --headless
  320. .It Fl -listen Ar address
  321. Start RPC server on this pipe or TCP socket.
  322. .It Fl h , -help
  323. Print usage information and exit.
  324. .It Fl v , -version
  325. Print version information and exit.
  326. .El
  327. .Sh ENVIRONMENT
  328. .Bl -tag -width Fl
  329. .It Ev NVIM_LOG_FILE
  330. Low-level log file, usually found at ~/.cache/nvim/log.
  331. :help $NVIM_LOG_FILE
  332. .It Ev VIM
  333. Used to locate user files, such as init.vim.
  334. System-dependent.
  335. :help $VIM
  336. .It Ev VIMRUNTIME
  337. Used to locate runtime files (documentation, syntax highlighting, etc.).
  338. .It Ev XDG_CONFIG_HOME
  339. Path to the user-local configuration directory, see
  340. .Sx FILES .
  341. Defaults to
  342. .Pa ~/.config .
  343. :help xdg
  344. .It Ev XDG_DATA_HOME
  345. Like
  346. .Ev XDG_CONFIG_HOME ,
  347. but used to store data not generally edited by the user,
  348. namely swap, backup, and ShaDa files.
  349. Defaults to
  350. .Pa ~/.local/share .
  351. :help xdg
  352. .It Ev VIMINIT
  353. Ex commands to be executed at startup.
  354. .Ic ":help VIMINIT"
  355. .It Ev SHELL
  356. Used to initialize the 'shell' option, which decides the default shell used by
  357. features like
  358. .Ic :terminal ,
  359. .Ic :! , and
  360. .Ic system() .
  361. .El
  362. .Sh FILES
  363. .Bl -tag -width "~/.config/nvim/init.vim"
  364. .It Pa ~/.config/nvim/init.vim
  365. User-local
  366. .Nm
  367. configuration file.
  368. .It Pa ~/.config/nvim
  369. User-local
  370. .Nm
  371. configuration directory.
  372. See also
  373. .Ev XDG_CONFIG_HOME .
  374. .It Pa $VIM/sysinit.vim
  375. System-global
  376. .Nm
  377. configuration file.
  378. .It Pa $VIM
  379. System-global
  380. .Nm
  381. runtime directory.
  382. .El
  383. .Sh AUTHORS
  384. Nvim was started by
  385. .An Thiago de Arruda .
  386. Most of Vim was written by
  387. .An -nosplit
  388. .An Bram Moolenaar .
  389. Vim is based on Stevie, worked on by
  390. .An Tim Thompson ,
  391. .An Tony Andrews ,
  392. and
  393. .An G.R. (Fred) Walter .
  394. .Ic ":help credits"