neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

nvim.1 (9360B)


      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 \(lq:help subject\(rq to get help on a specific subject.
     34 Use <Tab> and CTRL-D to complete subjects (\(lq:help cmdline-completion\(rq).
     35 .Pp
     36 The \(lqquickref\(rq 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\(aqs a good idea to run the self-check:
     43 .Dl :checkhealth
     44 .Bl -tag -width Fl
     45 .It Ar file ...
     46 File(s) to edit.
     47 Opens one buffer per file.
     48 To switch between buffers, use the
     49 .Ic :next
     50 and
     51 .Ic :previous
     52 commands.
     53 .It Fl
     54 Reads text from standard input until
     55 .Dv EOF ,
     56 then opens a buffer with that text.
     57 User input is read from standard error, which should be a terminal.
     58 .El
     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 \(aqerrorfile\(aq 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
     83 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 \(aqreadonly\(aq 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 \(aqwrite\(aq 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 \(aqwrite\(aq and \(aqmodifiable\(aq options, to disable file and
    121 buffer modifications.
    122 .It Fl b
    123 Binary mode.
    124 .Ic ":help edit-binary"
    125 .It Fl A
    126 Arabic mode.
    127 Sets the \(aqarabic\(aq option.
    128 .It Fl H
    129 Hebrew mode.
    130 Sets the \(aqhkmap\(aq and \(aqrightleft\(aq options.
    131 .It Fl V Ns Oo Ar N Oc Ns Op Ar file
    132 Verbose mode.
    133 Prints debug messages.
    134 .Ar N
    135 is the \(aqverbose\(aq level, defaults to
    136 .Cm 10 .
    137 If
    138 .Ar file
    139 is specified, append messages to
    140 .Ar file
    141 instead of printing them.
    142 .Ic ":help 'verbose'"
    143 .It Fl D
    144 Vimscript debug mode.
    145 Started when executing the first command from a script.
    146 .Ic ":help debug-mode"
    147 .It Fl n
    148 Disable the use of swap files.
    149 Sets the \(aqupdatecount\(aq option to
    150 .Cm 0 .
    151 Can be useful for editing files on a slow medium.
    152 .It Fl r Op Ar file
    153 Recovery mode.
    154 If
    155 .Ar file
    156 is omitted
    157 then list swap files with recovery information.
    158 Otherwise the swap file
    159 .Ar file
    160 is used to recover a crashed session.
    161 The swap file has the same name as the file it\(aqs associated with, but with
    162 .Sq .swp
    163 appended.
    164 .Ic ":help recovery"
    165 .It Fl L Op Ar file
    166 Alias for
    167 .Fl r .
    168 .It Fl u Ar vimrc
    169 Use
    170 .Ar vimrc
    171 instead of the default
    172 .Pa ~/.config/nvim/init.vim .
    173 If
    174 .Ar vimrc
    175 is
    176 .Cm NORC ,
    177 do not load any initialization files (except plugins).
    178 If
    179 .Ar vimrc
    180 is
    181 .Cm NONE ,
    182 loading plugins is also skipped.
    183 .Ic ":help initialization"
    184 .It Fl i Ar shada
    185 Use
    186 .Ar shada
    187 instead of the default
    188 .Pa ~/.local/state/nvim/shada/main.shada .
    189 If
    190 .Ar shada
    191 is
    192 .Cm NONE ,
    193 do not read or write a ShaDa file.
    194 .Ic ":help shada"
    195 .It Fl -noplugin
    196 Skip loading plugins (by setting the \(aqnoloadplugins\(aq option).
    197 Implied by
    198 .Cm -u NONE .
    199 .It Fl -clean
    200 Start Nvim with \(lqfactory defaults\(rq (only builtin plugins, no user
    201 config/plugins, no shada).
    202 .Ic ":help --clean"
    203 .It Fl o Ns Op Ar N
    204 Open
    205 .Ar N
    206 windows stacked horizontally.
    207 If
    208 .Ar N
    209 is omitted, open one window for each file.
    210 If
    211 .Ar N
    212 is less than the number of file arguments, allocate windows for the first
    213 .Ar N
    214 files and hide the rest.
    215 .It Fl O Ns Op Ar N
    216 Like
    217 .Fl o ,
    218 but tile windows vertically.
    219 .It Fl p Ns Op Ar N
    220 Like
    221 .Fl o ,
    222 but for tab pages.
    223 .It Cm + Ns Op Ar linenum
    224 For the first file, position the cursor on line
    225 .Ar linenum .
    226 If
    227 .Ar linenum
    228 is omitted, position the cursor on the last line of the file.
    229 .Cm +5
    230 and
    231 .Cm -c 5
    232 on the command-line are equivalent to
    233 .Ic :5
    234 inside
    235 .Nm .
    236 .It Cm +/ Ns Op Ar pattern
    237 For the first file, position the cursor on the first occurrence of
    238 .Ar pattern .
    239 If
    240 .Ar pattern
    241 is omitted, the most recent search pattern is used (if any).
    242 .Cm +/foo
    243 and
    244 .Cm -c /foo
    245 on the command-line are equivalent to
    246 .Ic /foo
    247 and
    248 .Ic :/foo
    249 inside
    250 .Nm .
    251 .Ic ":help search-pattern"
    252 .It Cm + Ns Ar command , Fl c Ar command
    253 Execute
    254 .Ar command
    255 after reading the first file.
    256 Up to 10 instances allowed.
    257 .Qq Cm +foo
    258 and
    259 .Cm -c \(dqfoo\(dq
    260 are equivalent.
    261 .It Fl -cmd Ar command
    262 Like
    263 .Fl c ,
    264 but execute
    265 .Ar command
    266 before processing any vimrc.
    267 Up to 10 instances of these can be used independently from instances of
    268 .Fl c .
    269 .It Fl l Ar script Op Ar args
    270 Execute Lua
    271 .Ar script
    272 with optional
    273 .Op Ar args
    274 after processing any preceding Nvim startup arguments.
    275 All
    276 .Op Ar args
    277 are treated as script arguments and are passed literally to Lua, that is,
    278 .Fl l
    279 stops processing of Nvim arguments.
    280 .Ic ":help -l"
    281 .It Fl S Op Ar session
    282 Execute
    283 .Ar session
    284 after the first file argument has been read.
    285 If
    286 .Ar session
    287 filename ends with
    288 .Pa .lua
    289 it is executed as Lua instead of Vimscript.
    290 Equivalent to
    291 .Cm -c \(dqsource session\(dq .
    292 .Ar session
    293 cannot start with a hyphen
    294 .Pq Sq - .
    295 If
    296 .Ar session
    297 is omitted then
    298 .Pa Session.vim
    299 is used, if found.
    300 .Ic ":help session-file"
    301 .It Fl s Ar scriptin
    302 Read normal mode commands from
    303 .Ar scriptin .
    304 The same can be done with the command
    305 .Ic ":source! scriptin" .
    306 If the end of the file is reached before
    307 .Nm
    308 exits, further characters are read from the keyboard.
    309 .It Fl w Ar scriptout
    310 Append all typed characters to
    311 .Ar scriptout .
    312 Can be used for creating a script to be used with
    313 .Fl s
    314 or
    315 .Ic :source\&! .
    316 .It Fl W Ar scriptout
    317 Like
    318 .Fl w ,
    319 but truncate
    320 .Ar scriptout .
    321 .It Fl -startuptime Ar file
    322 During startup, append timing messages to
    323 .Ar file .
    324 Can be used to diagnose slow startup times.
    325 .It Fl -api-info
    326 Dump API metadata serialized to msgpack and exit.
    327 .It Fl -embed
    328 Use standard input and standard output as a msgpack-rpc channel.
    329 .Ic ":help --embed"
    330 .It Fl -headless
    331 Do not start a UI.
    332 When supplied with
    333 .Cm --embed
    334 this implies that the embedding application does not intend to (immediately)
    335 start a UI.
    336 Also useful for \(lqscraping\(rq messages in a pipe.
    337 .Ic ":help --headless"
    338 .It Fl -listen Ar address
    339 Start RPC server on this pipe or TCP socket.
    340 .It Fl h , -help
    341 Print usage information and exit.
    342 .It Fl v , -version
    343 Print version information and exit.
    344 .El
    345 .Sh ENVIRONMENT
    346 .Bl -tag -width Fl
    347 .It Ev NVIM_APPNAME
    348 The name of sub-directories used within each XDG user directory.
    349 Defaults to
    350 .Cm nvim .
    351 .Ic ":help $NVIM_APPNAME"
    352 .It Ev NVIM_LOG_FILE
    353 Low-level log file, usually found at
    354 .Pa ~/.local/state/nvim/nvim.log .
    355 .Ic ":help $NVIM_LOG_FILE"
    356 .It Ev VIM
    357 Used to locate user files, such as init.vim.
    358 System-dependent.
    359 .Ic ":help $VIM"
    360 .It Ev VIMRUNTIME
    361 Used to locate runtime files (documentation, syntax highlighting, etc.).
    362 .It Ev XDG_CONFIG_HOME
    363 Path to the user-local configuration directory, see
    364 .Sx FILES .
    365 Defaults to
    366 .Pa ~/.config .
    367 .Ic ":help xdg"
    368 .It Ev XDG_STATE_HOME
    369 Like
    370 .Ev XDG_CONFIG_HOME ,
    371 but used to store data not generally edited by the user,
    372 namely swap, backup, and ShaDa files.
    373 Defaults to
    374 .Pa ~/.local/state .
    375 .Ic ":help xdg"
    376 .It Ev XDG_DATA_HOME
    377 Like
    378 .Ev XDG_CONFIG_HOME ,
    379 but used to store data not generally edited by the user,
    380 things like runtime files.
    381 Defaults to
    382 .Pa ~/.local/share .
    383 .Ic ":help xdg"
    384 .It Ev VIMINIT
    385 Ex commands to be executed at startup.
    386 .Ic ":help VIMINIT"
    387 .It Ev SHELL
    388 Used to initialize the \(aqshell\(aq option, which decides the default shell
    389 used by features like
    390 .Ic :terminal ,
    391 .Ic :! ,
    392 and
    393 .Ic system() .
    394 .El
    395 .Sh FILES
    396 .Bl -tag -width "~/.config/nvim/init.vim"
    397 .It Pa ~/.config/nvim/init.lua
    398 User-local
    399 .Nm
    400 Lua configuration file.
    401 .It Pa ~/.config/nvim
    402 User-local
    403 .Nm
    404 configuration directory.
    405 See also
    406 .Ev XDG_CONFIG_HOME .
    407 .It Pa $VIM/sysinit.vim
    408 System-global
    409 .Nm
    410 configuration file.
    411 .It Pa $VIM
    412 System-global
    413 .Nm
    414 runtime directory.
    415 .El
    416 .Sh AUTHORS
    417 Nvim was started by
    418 .An "Thiago de Arruda" .
    419 Most of Vim was written by
    420 .An -nosplit
    421 .An "Bram Moolenaar" .
    422 Vim is based on Stevie, worked on by
    423 .An "Tim Thompson" ,
    424 .An "Tony Andrews" ,
    425 and
    426 .An "G.R. (Fred) Walter" .
    427 .Ic ":help credits"