vim_diff.txt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. *vim_diff.txt* Nvim
  2. NVIM REFERENCE MANUAL
  3. Differences between Nvim and Vim *vim-differences*
  4. Nvim differs from Vim in many ways, although editor and Vimscript (not
  5. Vim9script) features are mostly identical. This document is a complete and
  6. centralized reference of the differences.
  7. Type |gO| to see the table of contents.
  8. ==============================================================================
  9. 1. Configuration *nvim-config*
  10. - Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for your |config|.
  11. - Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files.
  12. - Use `$XDG_STATE_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent
  13. session information. |shada|
  14. ==============================================================================
  15. 2. Defaults *nvim-defaults*
  16. - Filetype detection is enabled by default. This can be disabled by adding
  17. ":filetype off" to |init.vim|.
  18. - Syntax highlighting is enabled by default. This can be disabled by adding
  19. ":syntax off" to |init.vim|.
  20. - 'autoindent' is enabled
  21. - 'autoread' is enabled
  22. - 'background' defaults to "dark" (unless set automatically by the terminal/UI)
  23. - 'backspace' defaults to "indent,eol,start"
  24. - 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created
  25. - 'belloff' defaults to "all"
  26. - 'compatible' is always disabled
  27. - 'complete' excludes "i"
  28. - 'cscopeverbose' is enabled
  29. - 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
  30. - 'display' defaults to "lastline,msgsep"
  31. - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
  32. - 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│"
  33. - 'formatoptions' defaults to "tcqj"
  34. - 'fsync' is disabled
  35. - 'hidden' is enabled
  36. - 'history' defaults to 10000 (the maximum)
  37. - 'hlsearch' is enabled
  38. - 'incsearch' is enabled
  39. - 'joinspaces' is disabled
  40. - 'langnoremap' is enabled
  41. - 'langremap' is disabled
  42. - 'laststatus' defaults to 2 (statusline is always shown)
  43. - 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
  44. - 'mouse' defaults to "nvi"
  45. - 'mousemodel' defaults to "popup_setpos"
  46. - 'nrformats' defaults to "bin,hex"
  47. - 'ruler' is enabled
  48. - 'sessionoptions' includes "unix,slash", excludes "options"
  49. - 'shortmess' includes "F", excludes "S"
  50. - 'showcmd' is enabled
  51. - 'sidescroll' defaults to 1
  52. - 'smarttab' is enabled
  53. - 'startofline' is disabled
  54. - 'switchbuf' defaults to "uselast"
  55. - 'tabpagemax' defaults to 50
  56. - 'tags' defaults to "./tags;,tags"
  57. - 'ttimeoutlen' defaults to 50
  58. - 'ttyfast' is always set
  59. - 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created
  60. - 'viewoptions' includes "unix,slash", excludes "options"
  61. - 'viminfo' includes "!"
  62. - 'wildmenu' is enabled
  63. - 'wildoptions' defaults to "pum,tagfile"
  64. - |man.lua| plugin is enabled, so |:Man| is available by default.
  65. - |matchit| plugin is enabled. To disable it in your config: >
  66. :let loaded_matchit = 1
  67. - |g:vimsyn_embed| defaults to "l" to enable Lua highlighting
  68. Default Mouse ~
  69. *default-mouse* *disable-mouse*
  70. By default the mouse is enabled, and <RightMouse> opens a |popup-menu| with
  71. standard actions ("Cut", "Copy", "Paste", …). Mouse is NOT enabled in
  72. |command-mode| or the |more-prompt|, so you can temporarily disable it just by
  73. typing ":".
  74. If you don't like this you can disable the mouse in your |config| using any of
  75. the following:
  76. - Disable mouse completely by unsetting the 'mouse' option: >
  77. set mouse=
  78. - Pressing <RightMouse> extends selection instead of showing popup-menu: >
  79. set mousemodel=extend
  80. - Pressing <A-LeftMouse> releases mouse until the cursor moves: >
  81. nnoremap <A-LeftMouse> <Cmd>
  82. \ set mouse=<Bar>
  83. \ echo 'mouse OFF until next cursor-move'<Bar>
  84. \ autocmd CursorMoved * ++once set mouse&<Bar>
  85. \ echo 'mouse ON'<CR>
  86. <
  87. To remove the "How-to disable mouse" menu item and the separator above it: >vim
  88. aunmenu PopUp.How-to\ disable\ mouse
  89. aunmenu PopUp.-1-
  90. <
  91. Default Mappings ~
  92. *default-mappings*
  93. Nvim creates the following default mappings at |startup|. You can disable any
  94. of these in your config by simply removing the mapping, e.g. ":unmap Y".
  95. >
  96. nnoremap Y y$
  97. nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>
  98. inoremap <C-U> <C-G>u<C-U>
  99. inoremap <C-W> <C-G>u<C-W>
  100. xnoremap * y/\V<C-R>"<CR>
  101. xnoremap # y?\V<C-R>"<CR>
  102. nnoremap & :&&<CR>
  103. <
  104. Default Autocommands ~
  105. *default-autocmds*
  106. Default autocommands exist in the following groups. Use ":autocmd! {group}" to
  107. remove them and ":autocmd {group}" to see how they're defined.
  108. nvim_terminal:
  109. - BufReadCmd: Treats "term://" buffers as |terminal| buffers. |terminal-start|
  110. nvim_cmdwin:
  111. - CmdwinEnter: Limits syntax sync to maxlines=1 in the |cmdwin|.
  112. ==============================================================================
  113. 3. New Features *nvim-features*
  114. MAJOR COMPONENTS ~
  115. API |API|
  116. Job control |job-control|
  117. LSP framework |lsp|
  118. Lua scripting |lua|
  119. Parsing engine |treesitter|
  120. Providers
  121. Clipboard |provider-clipboard|
  122. Node.js plugins |provider-nodejs|
  123. Python plugins |provider-python|
  124. Ruby plugins |provider-ruby|
  125. Remote plugins |remote-plugin|
  126. Shared data |shada|
  127. Terminal emulator |terminal|
  128. Vimscript parser |nvim_parse_expression()|
  129. XDG base directories |xdg|
  130. USER EXPERIENCE ~
  131. Working intuitively and consistently is a major goal of Nvim.
  132. *feature-compile*
  133. - Nvim always includes ALL features, in contrast to Vim (which ships with
  134. various combinations of 100+ optional features). Think of it as a leaner
  135. version of Vim's "HUGE" build. This reduces surface area for bugs, and
  136. removes a common source of confusion and friction for users.
  137. - Nvim avoids features that cannot be provided on all platforms; instead that
  138. is delegated to external plugins/extensions. E.g. the `-X` platform-specific
  139. option is "sometimes" available in Vim (with potential surprises:
  140. https://stackoverflow.com/q/14635295).
  141. - Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
  142. not exposed (nor implemented); instead Nvim has a robust API.
  143. - Behaviors, options, documentation are removed if they cost users more time
  144. than they save.
  145. Usability details have been improved where the benefit outweighs any
  146. backwards-compatibility cost. Some examples:
  147. - Directories for 'directory' and 'undodir' are auto-created.
  148. - Terminal features such as 'guicursor' are enabled where possible.
  149. Some features are built in that otherwise required external plugins:
  150. - Highlighting the yanked region, see |lua-highlight|.
  151. ARCHITECTURE ~
  152. External plugins run in separate processes. |remote-plugin| This improves
  153. stability and allows those plugins to work without blocking the editor. Even
  154. "legacy" Python and Ruby plugins which use the old Vim interfaces (|if_pyth|,
  155. |if_ruby|) run out-of-process.
  156. Platform and I/O facilities are built upon libuv. Nvim benefits from libuv
  157. features and bug fixes, and other projects benefit from improvements to libuv
  158. by Nvim developers.
  159. FEATURES ~
  160. Command-line highlighting:
  161. The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted
  162. using a built-in Vimscript expression parser. |expr-highlight|
  163. *E5408* *E5409*
  164. |input()|, |inputdialog()| support custom highlighting. |input()-highlight|
  165. *g:Nvim_color_cmdline*
  166. (Experimental) Command-line (|:|) is colored by callback defined in
  167. `g:Nvim_color_cmdline` (this callback is for testing only, and will be
  168. removed in the future).
  169. Commands:
  170. |:checkhealth|
  171. |:drop| is always available
  172. |:Man| is available by default, with many improvements such as completion
  173. |:match| can be invoked before highlight group is defined
  174. |:source| works with Lua
  175. User commands can support |:command-preview| to show results as you type
  176. Events:
  177. |RecordingEnter|
  178. |RecordingLeave|
  179. |SearchWrapped|
  180. |Signal|
  181. |TabNewEntered|
  182. |TermClose|
  183. |TermOpen|
  184. |UIEnter|
  185. |UILeave|
  186. Functions:
  187. |dictwatcheradd()| notifies a callback whenever a |Dict| is modified
  188. |dictwatcherdel()|
  189. |menu_get()|
  190. |msgpackdump()|, |msgpackparse()| provide msgpack de/serialization
  191. |stdpath()|
  192. |system()|, |systemlist()| can run {cmd} directly (without 'shell')
  193. |matchadd()| can be called before highlight group is defined
  194. Highlight groups:
  195. |highlight-blend| controls blend level for a highlight group
  196. |expr-highlight| highlight groups (prefixed with "Nvim")
  197. |hl-NormalFloat| highlights floating window
  198. |hl-NormalNC| highlights non-current windows
  199. |hl-MsgArea| highlights messages/cmdline area
  200. |hl-MsgSeparator| highlights separator for scrolled messages
  201. |hl-Substitute|
  202. |hl-TermCursor|
  203. |hl-TermCursorNC|
  204. |hl-WinSeparator| highlights window separators
  205. |hl-Whitespace| highlights 'listchars' whitespace
  206. Input/Mappings:
  207. ALT (|META|) chords always work (even in the |TUI|). Map |<M-| with any key:
  208. <M-1>, <M-BS>, <M-Del>, <M-Ins>, <M-/>, <M-\>, <M-Space>, <M-Enter>, etc.
  209. Case-sensitive: <M-a> and <M-A> are two different keycodes.
  210. ALT may behave like <Esc> if not mapped. |i_ALT| |v_ALT| |c_ALT|
  211. Normal commands:
  212. |gO| shows a filetype-defined "outline" of the current buffer.
  213. Options:
  214. 'cpoptions' flags: |cpo-_|
  215. 'display' flags: "msgsep" minimizes scrolling when showing messages
  216. 'guicursor' works in the terminal
  217. 'fillchars' flags: "msgsep" (see 'display'), "horiz", "horizup",
  218. "horizdown", "vertleft", "vertright", "verthoriz"
  219. 'foldcolumn' supports up to 9 dynamic/fixed columns
  220. 'inccommand' shows interactive results for |:substitute|-like commands
  221. and |:command-preview| commands
  222. 'laststatus' global statusline support
  223. 'mousescroll' amount to scroll by when scrolling with a mouse
  224. 'pumblend' pseudo-transparent popupmenu
  225. 'scrollback'
  226. 'signcolumn' supports up to 9 dynamic/fixed columns
  227. 'statusline' supports unlimited alignment sections
  228. 'tabline' %@Func@foo%X can call any function on mouse-click
  229. 'winblend' pseudo-transparency in floating windows |api-floatwin|
  230. 'winhighlight' window-local highlights
  231. Signs:
  232. Signs are removed if the associated line is deleted.
  233. Variables:
  234. |v:progpath| is always absolute ("full")
  235. |v:windowid| is always available (for use by external UIs)
  236. ==============================================================================
  237. 4. Changed features *nvim-features-changed*
  238. Nvim always builds with all features, in contrast to Vim which may have
  239. certain features removed/added at compile-time. |feature-compile|
  240. Some Vim features were changed in Nvim, and vice versa.
  241. If a Python interpreter is available on your `$PATH`, |:python| and |:python3|
  242. are always available and may be used simultaneously. See |provider-python|.
  243. |:redir| nested in |execute()| works.
  244. |mkdir()| behaviour changed:
  245. 1. Assuming /tmp/foo does not exist and /tmp can be written to
  246. mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
  247. with 0700 permissions. Vim mkdir will create /tmp/foo with 0755.
  248. 2. If you try to create an existing directory with `'p'` (e.g. mkdir('/',
  249. 'p')) mkdir() will silently exit. In Vim this was an error.
  250. 3. mkdir() error messages now include strerror() text when mkdir fails.
  251. |string()| and |:echo| behaviour changed:
  252. 1. No maximum recursion depth limit is applied to nested container
  253. structures.
  254. 2. |string()| fails immediately on nested containers, not when recursion limit
  255. was exceeded.
  256. 2. When |:echo| encounters duplicate containers like >
  257. let l = []
  258. echo [l, l]
  259. <
  260. it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is
  261. only used for recursive containers.
  262. 3. |:echo| printing nested containers adds "@level" after "..." designating
  263. the level at which recursive container was printed: |:echo-self-refer|.
  264. Same thing applies to |string()| (though it uses construct like
  265. "{E724@level}"), but this is not reliable because |string()| continues to
  266. error out.
  267. 4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled
  268. back.
  269. 5. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in
  270. nothing, E908, in Nvim it is internal error.
  271. |json_decode()| behaviour changed:
  272. 1. It may output |msgpack-special-dict|.
  273. 2. |msgpack-special-dict| is emitted also in case of duplicate keys, while in
  274. Vim it errors out.
  275. 3. It accepts only valid JSON. Trailing commas are not accepted.
  276. |json_encode()| behaviour slightly changed: now |msgpack-special-dict| values
  277. are accepted, but |v:none| is not.
  278. Viminfo text files were replaced with binary (messagepack) ShaDa files.
  279. Additional differences:
  280. - |shada-c| has no effect.
  281. - |shada-s| now limits size of every item and not just registers.
  282. - 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for
  283. compatibility reasons.
  284. - |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
  285. commands are still kept.
  286. - ShaDa file format was designed with forward and backward compatibility in
  287. mind. |shada-compatibility|
  288. - Some errors make ShaDa code keep temporary file in-place for user to decide
  289. what to do with it. Vim deletes temporary file in these cases.
  290. |shada-error-handling|
  291. - ShaDa file keeps search direction (|v:searchforward|), viminfo does not.
  292. |printf()| returns something meaningful when used with `%p` argument: in Vim
  293. it used to return useless address of the string (strings are copied to the
  294. newly allocated memory all over the place) and fail on types which cannot be
  295. coerced to strings. See |id()| for more details, currently it uses
  296. `printf("%p", {expr})` internally.
  297. |c_CTRL-R| pasting a non-special register into |cmdline| omits the last <CR>.
  298. |CursorMoved| always triggers when moving between windows.
  299. Lua interface (|lua.txt|):
  300. - `:lua print("a\0b")` will print `a^@b`, like with `:echomsg "a\nb"` . In Vim
  301. that prints `a` and `b` on separate lines, exactly like
  302. `:lua print("a\nb")` .
  303. - `:lua error('TEST')` emits the error “E5105: Error while calling lua chunk:
  304. [string "<VimL compiled string>"]:1: TEST”, whereas Vim emits only “TEST”.
  305. - Lua has direct access to Nvim |API| via `vim.api`.
  306. - Lua package.path and package.cpath are automatically updated according to
  307. 'runtimepath': |lua-require|.
  308. Commands:
  309. |:doautocmd| does not warn about "No matching autocommands".
  310. |:wincmd| accepts a count.
  311. `:write!` does not show a prompt if the file was updated externally.
  312. Command line completion:
  313. The meanings of arrow keys do not change depending on 'wildoptions'.
  314. Functions:
  315. |input()| and |inputdialog()| support for each other’s features (return on
  316. cancel and completion respectively) via dictionary argument (replaces all
  317. other arguments if used), and "cancelreturn" can have any type if passed in
  318. a dictionary.
  319. |input()| and |inputdialog()| support user-defined cmdline highlighting.
  320. Highlight groups:
  321. |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other
  322. groups
  323. |hl-CurSearch| highlights match under cursor instead of last match found
  324. using |n| or |N|
  325. |hl-CursorLine| is low-priority unless foreground color is set
  326. |hl-VertSplit| superseded by |hl-WinSeparator|
  327. Highlight groups names are allowed to contain the characters `.` and `@`.
  328. It is an error to define a highlight group with a name that doesn't match
  329. the regexp `[a-zA-Z0-9_.@]*` (see |group-name|).
  330. Macro/|recording| behavior
  331. Replay of a macro recorded during :lmap produces the same actions as when it
  332. was recorded. In Vim if a macro is recorded while using :lmap'ped keys then
  333. the behaviour during record and replay differs.
  334. 'keymap' is implemented via :lmap instead of :lnoremap so that you can use
  335. macros and 'keymap' at the same time. This also means you can use |:imap| on
  336. the results of keys from 'keymap'.
  337. Mappings:
  338. Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an
  339. existing mapping for its simplified form (e.g. <Tab>).
  340. Motion:
  341. The |jumplist| avoids useless/phantom jumps.
  342. Normal commands:
  343. |Q| replays the last recorded macro instead of switching to Ex mode.
  344. Instead |gQ| can be used to enter Ex mode.
  345. Options:
  346. 'ttimeout', 'ttimeoutlen' behavior was simplified
  347. 'jumpoptions' "stack" behavior
  348. 'jumpoptions' "view" tries to restore the |mark-view| when moving through
  349. the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
  350. 'shortmess' the "F" flag does not affect output from autocommands
  351. Shell:
  352. Shell output (|:!|, |:make|, …) is always routed through the UI, so it
  353. cannot "mess up" the screen. (You can still use "chansend(v:stderr,…)" if
  354. you want to mess up the screen :)
  355. Nvim throttles (skips) messages from shell commands (|:!|, |:grep|, |:make|)
  356. if there is too much output. No data is lost, this only affects display and
  357. improves performance. |:terminal| output is never throttled.
  358. |:!| does not support "interactive" commands. Use |:terminal| instead.
  359. (GUI Vim has a similar limitation, see ":help gui-pty" in Vim.)
  360. :!start is not special-cased on Windows.
  361. |system()| does not support writing/reading "backgrounded" commands. |E5677|
  362. Startup:
  363. |-e| and |-es| invoke the same "improved Ex mode" as -E and -Es.
  364. |-E| and |-Es| read stdin as text (into buffer 1).
  365. |-es| and |-Es| have improved behavior:
  366. - Quits automatically, don't need "-c qa!".
  367. - Skips swap-file dialog.
  368. |-s| reads Normal commands from stdin if the script name is "-".
  369. Reading text (instead of commands) from stdin |--|:
  370. - works by default: "-" file is optional
  371. - works in more cases: |-Es|, file args
  372. Syntax highlighting:
  373. syncolor.vim has been removed. Nvim now sets up default highlighting groups
  374. automatically for both light and dark backgrounds, regardless of whether or
  375. not syntax highlighting is enabled. This means that |:syntax-on| and
  376. |:syntax-enable| are now identical. Users who previously used an
  377. after/syntax/syncolor.vim file should transition that file into a
  378. colorscheme. |:colorscheme|
  379. TUI:
  380. *:set-termcap*
  381. Start Nvim with 'verbose' level 3 to show terminal capabilities: >
  382. nvim -V3
  383. <
  384. *'term'* *E529* *E530* *E531*
  385. 'term' reflects the terminal type derived from |$TERM| and other environment
  386. checks. For debugging only; not reliable during startup. >
  387. :echo &term
  388. < "builtin_x" means one of the |builtin-terms| was chosen, because the expected
  389. terminfo file was not found on the system.
  390. Nvim will use 256-colour capability on Linux virtual terminals. Vim uses
  391. only 8 colours plus bright foreground on Linux VTs.
  392. Vim combines what is in its |builtin-terms| with what it reads from terminfo,
  393. and has a 'ttybuiltin' setting to control how that combination works. Nvim
  394. uses one or the other, it does not attempt to merge the two.
  395. UI/Display:
  396. |Visual| selection highlights the character at cursor. |visual-use|
  397. Vimscript compatibility:
  398. `count` does not alias to |v:count|
  399. `errmsg` does not alias to |v:errmsg|
  400. `shell_error` does not alias to |v:shell_error|
  401. `this_session` does not alias to |v:this_session|
  402. Working directory (Vim implemented some of these later than Nvim):
  403. - |DirChanged| and |DirChangedPre| can be triggered when switching to another
  404. window or tab.
  405. - |getcwd()| and |haslocaldir()| may throw errors if the tab page or window
  406. cannot be found. *E5000* *E5001* *E5002*
  407. - |haslocaldir()| checks for tab-local directory if and only if -1 is passed as
  408. window number, and its only possible returns values are 0 and 1.
  409. - `getcwd(-1)` is equivalent to `getcwd(-1, 0)` instead of returning the global
  410. working directory. Use `getcwd(-1, -1)` to get the global working directory.
  411. ==============================================================================
  412. 5. Missing legacy features *nvim-features-missing*
  413. Some legacy Vim features are not yet implemented:
  414. - *if_lua* : Nvim |Lua| API is not compatible with Vim's "if_lua"
  415. - *if_mzscheme*
  416. - |if_pyth|: *python-bindeval* *python-Function* are not supported
  417. - *if_tcl*
  418. *:gui*
  419. *:gvim*
  420. ==============================================================================
  421. 6. Removed features *nvim-features-removed*
  422. These Vim features were intentionally removed from Nvim.
  423. Aliases:
  424. ex (alias for "nvim -e")
  425. exim (alias for "nvim -E")
  426. gex (GUI)
  427. gview (GUI)
  428. gvim (GUI)
  429. gvimdiff (GUI)
  430. rgview (GUI)
  431. rgvim (GUI)
  432. rview
  433. rvim
  434. view (alias for "nvim -R")
  435. vimdiff (alias for "nvim -d" |diff-mode|)
  436. Commands:
  437. :fixdel
  438. :helpfind
  439. :mode (no longer accepts an argument)
  440. :open
  441. :Print
  442. :promptfind
  443. :promptrepl
  444. :scriptversion (always version 1)
  445. :shell
  446. :sleep! (does not hide the cursor; same as :sleep)
  447. :smile
  448. :tearoff
  449. Compile-time features:
  450. Emacs tags support
  451. X11 integration (see |x11-selection|)
  452. Eval:
  453. Vim9script
  454. *js_encode()*
  455. *js_decode()*
  456. *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead.
  457. *v:sizeofint*
  458. *v:sizeoflong*
  459. *v:sizeofpointer*
  460. Events:
  461. *SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead.
  462. Highlight groups:
  463. *hl-StatusLineTerm* *hl-StatusLineTermNC* are unnecessary because Nvim
  464. supports 'winhighlight' window-local highlights.
  465. For example, to mimic Vim's StatusLineTerm: >
  466. hi StatusLineTerm ctermfg=black ctermbg=green
  467. hi StatusLineTermNC ctermfg=green
  468. autocmd TermOpen,WinEnter * if &buftype=='terminal'
  469. \|setlocal winhighlight=StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC
  470. \|else|setlocal winhighlight=|endif
  471. <
  472. Options:
  473. antialias
  474. *'balloondelay'* *'bdlay'*
  475. *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
  476. *'balloonexpr'* *'bexpr'*
  477. bioskey (MS-DOS)
  478. conskey (MS-DOS)
  479. *'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".)
  480. 'cpoptions' (gjkHw<*- and all POSIX flags were removed)
  481. *'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation)
  482. *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
  483. 'encoding' ("utf-8" is always used)
  484. esckeys
  485. 'guioptions' "t" flag was removed
  486. *'guifontset'* *'gfs'* (Use 'guifont' instead.)
  487. *'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.)
  488. 'highlight' (Names of builtin |highlight-groups| cannot be changed.)
  489. *'imactivatefunc'* *'imaf'*
  490. *'imactivatekey'* *'imak'*
  491. *'imstatusfunc'* *'imsf'*
  492. *'insertmode'* *'im'* Use the following script to emulate 'insertmode':
  493. >
  494. autocmd BufWinEnter * startinsert
  495. inoremap <Esc> <C-X><C-Z><C-]>
  496. inoremap <C-C> <C-X><C-Z>
  497. inoremap <C-L> <C-X><C-Z><C-]><Esc>
  498. inoremap <C-Z> <C-X><C-Z><Cmd>suspend<CR>
  499. noremap <C-C> <Esc>
  500. snoremap <C-C> <Esc>
  501. noremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR>
  502. cnoremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR>
  503. inoremap <C-\><C-G> <C-X><C-Z>
  504. autocmd CmdWinEnter * noremap <buffer> <C-C> <C-C>
  505. autocmd CmdWinEnter * inoremap <buffer> <C-C> <C-C>
  506. lua << EOF
  507. vim.on_key(function(c)
  508. if c == '\27' then
  509. local mode = vim.api.nvim_get_mode().mode
  510. if mode:find('^[nvV\22sS\19]') and vim.fn.getcmdtype() == '' then
  511. vim.schedule(function()
  512. vim.cmd('startinsert')
  513. end)
  514. end
  515. end
  516. end)
  517. EOF
  518. <
  519. *'macatsui'*
  520. *'maxcombine'* *'mco'*
  521. Nvim always displays up to 6 combining characters. You can still edit
  522. text with more than 6 combining characters, you just can't see them.
  523. Use |g8| or |ga|. See |mbyte-combining|.
  524. *'maxmem'* Nvim delegates memory-management to the OS.
  525. *'maxmemtot'* Nvim delegates memory-management to the OS.
  526. *'prompt'* *'noprompt'*
  527. *'remap'* *'noremap'*
  528. *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
  529. *'shelltype'*
  530. *'shortname'* *'sn'* *'noshortname'* *'nosn'*
  531. *'swapsync'* *'sws'*
  532. *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows)
  533. *'terse'* *'noterse'* (Add "s" to 'shortmess' instead)
  534. textauto
  535. textmode
  536. *'toolbar'* *'tb'*
  537. *'toolbariconsize'* *'tbis'*
  538. *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
  539. *'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
  540. *'ttymouse'* *'ttym'*
  541. *'ttyscroll'* *'tsl'*
  542. *'ttytype'* *'tty'*
  543. weirdinvert
  544. Performance:
  545. Folds are not updated during insert-mode.
  546. Startup:
  547. --literal (file args are always literal; to expand wildcards on Windows, use
  548. |:n| e.g. `nvim +"n *"`)
  549. Easy mode: eview, evim, nvim -y
  550. Restricted mode: rview, rvim, nvim -Z
  551. Vi mode: nvim -v
  552. Test functions:
  553. test_alloc_fail()
  554. test_autochdir()
  555. test_disable_char_avail()
  556. test_feedinput()
  557. test_garbagecollect_soon
  558. test_getvalue()
  559. test_ignore_error()
  560. test_null_blob()
  561. test_null_channel()
  562. test_null_dict()
  563. test_null_function()
  564. test_null_job()
  565. test_null_list()
  566. test_null_partial()
  567. test_null_string()
  568. test_option_not_set()
  569. test_override()
  570. test_refcount()
  571. test_scrollbar()
  572. test_setmouse()
  573. test_settime()
  574. test_srand_seed()
  575. TUI:
  576. *t_xx* *termcap-options* *t_AB* *t_Sb* *t_vb* *t_SI*
  577. Nvim does not have special `t_XX` options nor <t_XX> keycodes to configure
  578. terminal capabilities. Instead Nvim treats the terminal as any other UI,
  579. e.g. 'guicursor' sets the terminal cursor style if possible.
  580. *termcap*
  581. Nvim never uses the termcap database, only |terminfo| and |builtin-terms|.
  582. *xterm-8bit* *xterm-8-bit*
  583. Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this
  584. requires autodetection of whether the terminal is in UTF-8 mode or non-UTF-8
  585. mode, as the 8-bit CSI character has to be written differently in each case.
  586. Vim issues a "request version" sequence to the terminal at startup and looks
  587. at how the terminal is sending CSI. Nvim does not issue such a sequence and
  588. always uses 7-bit control sequences.
  589. ==============================================================================
  590. vim:tw=78:ts=8:sw=2:et:ft=help:norl: