nvim.1 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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 eight 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. If
  182. .Ar vimrc
  183. is
  184. .Cm NONE ,
  185. loading plugins is also skipped.
  186. .Ic ":help initialization"
  187. .It Fl i Ar shada
  188. Use
  189. .Ar shada
  190. instead of the default
  191. .Pa ~/.local/share/nvim/shada/main.shada .
  192. If
  193. .Ar shada
  194. is
  195. .Cm NONE ,
  196. do not read or write a ShaDa file.
  197. .Ic ":help shada"
  198. .It Fl -noplugin
  199. Skip loading plugins.
  200. Implied by
  201. .Cm -u NONE .
  202. .It Fl -clean
  203. Mimic a fresh install of Nvim. Skip loading non-builtin plugins and shada (viminfo) file.
  204. .It Fl o Ns Op Ar N
  205. Open
  206. .Ar N
  207. windows stacked horizontally.
  208. If
  209. .Ar N
  210. is omitted, open one window for each file.
  211. If
  212. .Ar N
  213. is less than the number of file arguments, allocate windows for the first
  214. .Ar N
  215. files and hide the rest.
  216. .It Fl O Ns Op Ar N
  217. Like
  218. .Fl o ,
  219. but tile windows vertically.
  220. .It Fl p Ns Op Ar N
  221. Like
  222. .Fl o ,
  223. but for tab pages.
  224. .It Cm + Ns Op Ar linenum
  225. For the first file, position the cursor on line
  226. .Ar linenum .
  227. If
  228. .Ar linenum
  229. is omitted, position the cursor on the last line of the file.
  230. .Cm +5
  231. and
  232. .Cm -c 5
  233. on the command-line are equivalent to
  234. .Ic :5
  235. inside
  236. .Nm .
  237. .It Cm +/ Ns Op Ar pattern
  238. For the first file, position the cursor on the first occurrence of
  239. .Ar pattern .
  240. If
  241. .Ar pattern
  242. is omitted, the most recent search pattern is used (if any).
  243. .Cm +/foo
  244. and
  245. .Cm -c /foo
  246. on the command-line are equivalent to
  247. .Ic /foo
  248. and
  249. .Ic :/foo
  250. inside
  251. .Nm .
  252. .Ic ":help search-pattern"
  253. .It \fB\+\fR\fI\,command\/\fR , Fl c Ar command
  254. Execute
  255. .Ar command
  256. after reading the first file.
  257. Up to 10 instances allowed.
  258. .Qq Cm +foo
  259. and
  260. .Cm -c \(dqfoo\(dq
  261. are equivalent.
  262. .It Fl -cmd Ar command
  263. Like
  264. .Fl c ,
  265. but execute
  266. .Ar command
  267. before processing any vimrc.
  268. Up to 10 instances of these can be used independently from instances of
  269. .Fl c .
  270. .It Fl S Op Ar session
  271. Source
  272. .Ar session
  273. after the first file argument has been read.
  274. Equivalent to
  275. .Cm -c \(dqsource session\(dq .
  276. .Ar session
  277. cannot start with a hyphen
  278. .Pq Sq - .
  279. If
  280. .Ar session
  281. is omitted then
  282. .Pa Session.vim
  283. is used, if found.
  284. .Ic ":help session-file"
  285. .It Fl s Ar scriptin
  286. Read normal mode commands from
  287. .Ar scriptin .
  288. The same can be done with the command
  289. .Ic ":source! scriptin" .
  290. If the end of the file is reached before
  291. .Nm
  292. exits, further characters are read from the keyboard.
  293. .It Fl w Ar scriptout
  294. Append all typed characters to
  295. .Ar scriptout .
  296. Can be used for creating a script to be used with
  297. .Fl s
  298. or
  299. .Ic :source! .
  300. .It Fl W Ar scriptout
  301. Like
  302. .Fl w ,
  303. but truncate
  304. .Ar scriptout .
  305. .It Fl -startuptime Ar file
  306. During startup, append timing messages to
  307. .Ar file .
  308. Can be used to diagnose slow startup times.
  309. .It Fl -api-info
  310. Dump API metadata serialized to msgpack and exit.
  311. .It Fl -embed
  312. Use standard input and standard output as a msgpack-rpc channel.
  313. :help --embed
  314. .It Fl -headless
  315. Do not start a UI.
  316. When supplied with --embed this implies that the embedding application does not intend to (immediately) start a UI.
  317. Also useful for "scraping" messages in a pipe.
  318. :help --headless
  319. .It Fl -listen Ar address
  320. Start RPC server on this pipe or TCP socket.
  321. .It Fl h , -help
  322. Print usage information and exit.
  323. .It Fl v , -version
  324. Print version information and exit.
  325. .El
  326. .Sh ENVIRONMENT
  327. .Bl -tag -width Fl
  328. .It Ev NVIM_LOG_FILE
  329. Low-level log file, usually found at ~/.cache/nvim/log.
  330. :help $NVIM_LOG_FILE
  331. .It Ev VIM
  332. Used to locate user files, such as init.vim.
  333. System-dependent.
  334. :help $VIM
  335. .It Ev VIMRUNTIME
  336. Used to locate runtime files (documentation, syntax highlighting, etc.).
  337. .It Ev XDG_CONFIG_HOME
  338. Path to the user-local configuration directory, see
  339. .Sx FILES .
  340. Defaults to
  341. .Pa ~/.config .
  342. :help xdg
  343. .It Ev XDG_DATA_HOME
  344. Like
  345. .Ev XDG_CONFIG_HOME ,
  346. but used to store data not generally edited by the user,
  347. namely swap, backup, and ShaDa files.
  348. Defaults to
  349. .Pa ~/.local/share .
  350. :help xdg
  351. .It Ev VIMINIT
  352. Ex commands to be executed at startup.
  353. .Ic ":help VIMINIT"
  354. .It Ev SHELL
  355. Used to initialize the 'shell' option, which decides the default shell used by
  356. features like
  357. .Ic :terminal ,
  358. .Ic :! , and
  359. .Ic system() .
  360. .El
  361. .Sh FILES
  362. .Bl -tag -width "~/.config/nvim/init.vim"
  363. .It Pa ~/.config/nvim/init.vim
  364. User-local
  365. .Nm
  366. configuration file.
  367. .It Pa ~/.config/nvim
  368. User-local
  369. .Nm
  370. configuration directory.
  371. See also
  372. .Ev XDG_CONFIG_HOME .
  373. .It Pa $VIM/sysinit.vim
  374. System-global
  375. .Nm
  376. configuration file.
  377. .It Pa $VIM
  378. System-global
  379. .Nm
  380. runtime directory.
  381. .El
  382. .Sh AUTHORS
  383. Nvim was started by
  384. .An Thiago de Arruda .
  385. Most of Vim was written by
  386. .An -nosplit
  387. .An Bram Moolenaar .
  388. Vim is based on Stevie, worked on by
  389. .An Tim Thompson ,
  390. .An Tony Andrews ,
  391. and
  392. .An G.R. (Fred) Walter .
  393. .Ic ":help credits"