nvim.1 8.2 KB

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