vim_diff.txt (37341B)
1 *vim_diff.txt* Nvim 2 3 4 NVIM REFERENCE MANUAL 5 6 7 Differences between Nvim and Vim *vim-differences* 8 9 Nvim differs from Vim in many ways, although editor and Vimscript (not 10 Vim9script) features are mostly identical. This document is a complete and 11 centralized reference of the differences. 12 13 Type |gO| to see the table of contents. 14 15 ============================================================================== 16 Configuration *nvim-config* 17 18 User configuration and data files are found in standard |base-directories| 19 (see also |$NVIM_APPNAME|). Note in particular: 20 21 - Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for your |config|. 22 - Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files. 23 - Use `$XDG_STATE_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent 24 session information. |shada| 25 26 ============================================================================== 27 Defaults *defaults* *nvim-defaults* 28 29 - Filetype detection is enabled by default. This can be disabled by adding 30 ":filetype off" to |init.vim|. 31 - Syntax highlighting is enabled by default. This can be disabled by adding 32 ":syntax off" to |init.vim|. 33 - Default color scheme has been updated. This can result in color schemes 34 looking differently due to them relying on how highlight groups are defined 35 by default. Add ":colorscheme vim" to |init.vim| or 36 ":source $VIMRUNTIME/colors/vim.lua" to your color scheme file to restore 37 the old default links and colors. See |:highlight| for a list of highlight 38 groups colorschemes should set. 39 40 - 'autoindent' is enabled 41 - 'autoread' is enabled (works in all UIs, including terminal) 42 - 'background' defaults to "dark" (unless set automatically by the terminal/UI) 43 - 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created 44 - 'belloff' defaults to "all" 45 - 'comments' includes "fb:•" 46 - 'commentstring' defaults to "" 47 - 'compatible' is always disabled 48 - 'complete' excludes "i" 49 - 'completeopt' defaults to "menu,popup" 50 - 'define' defaults to "". The C ftplugin sets it to "^\\s*#\\s*define" 51 - 'diffopt' includes "linematch:40" 52 - 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created 53 - 'display' defaults to "lastline" 54 - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding) 55 - 'fillchars' defaults (in effect) to "vert:│,fold:·,foldsep:│" 56 - 'formatoptions' defaults to "tcqj" 57 - 'grepprg' uses the -H and -I flags for regular grep, 58 and defaults to using ripgrep if available 59 - 'hidden' is enabled 60 - 'history' defaults to 10000 (the maximum) 61 - 'hlsearch' is enabled 62 - 'include' defaults to "". The C ftplugin sets it to "^\\s*#\\s*include" 63 - 'incsearch' is enabled 64 - 'isfname' does not include ":" (on Windows). Drive letters are handled 65 correctly without it. (Use |gF| for filepaths suffixed with ":line:col"). 66 - 'joinspaces' is disabled 67 - 'jumpoptions' defaults to "clean" 68 - 'langnoremap' is enabled 69 - 'langremap' is disabled 70 - 'laststatus' defaults to 2 (statusline is always shown) 71 - 'listchars' defaults to "tab:> ,trail:-,nbsp:+" 72 - 'maxsearchcount' defaults to 999 73 - 'mouse' defaults to "nvi", see |default-mouse| for details 74 - 'mousemodel' defaults to "popup_setpos" 75 - 'nrformats' defaults to "bin,hex" 76 - 'path' defaults to ".,,". The C ftplugin adds "/usr/include" if it exists. 77 - 'sessionoptions' includes "unix,slash", excludes "options" 78 - 'shortmess' includes "CF", excludes "S" 79 - 'sidescroll' defaults to 1 80 - 'smarttab' is enabled 81 - 'spellfile' defaults to `stdpath("data").."/site/spell/"` 82 - 'startofline' is disabled 83 - 'switchbuf' defaults to "uselast" 84 - 'tabpagemax' defaults to 50 85 - 'tags' defaults to "./tags;,tags" 86 - 'termguicolors' is enabled by default if Nvim can detect support from the 87 host terminal 88 - 'ttimeout' is enabled 89 - 'ttimeoutlen' defaults to 50 90 - 'ttyfast' is always set 91 - 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created 92 - 'viewoptions' includes "unix,slash", excludes "options" 93 - 'viminfo' includes "!" 94 - 'wildoptions' defaults to "pum,tagfile" 95 96 - |editorconfig| plugin is enabled, .editorconfig settings are applied. 97 - |man.lua| plugin is enabled, so |:Man| is available by default. 98 - |matchit| plugin is enabled. To disable it in your config: >vim 99 :let loaded_matchit = 1 100 - |spellfile.lua| plugin is enabled, spellfiles are installed by default if 101 missing. 102 103 - |g:vimsyn_embed| defaults to "l" to enable Lua highlighting 104 105 DEFAULT MOUSE 106 *default-mouse* *disable-mouse* 107 By default the mouse is enabled. This means |scroll-mouse-wheel| will scroll 108 the window instead of moving the cursor; <LeftMouse> click places the cursor; 109 and <RightMouse> click opens the default |popup-menu| with standard actions. 110 111 Mouse is NOT enabled in |Cmdline-mode| or the |more-prompt|, so you can 112 temporarily disable it just by typing ":". Or if you want to partially or 113 fully disable the mouse or popup-menu, do any of the following: 114 115 - Disable mouse completely by unsetting the 'mouse' option: >vim 116 set mouse= 117 - Change the 'mousemodel', so <RightMouse> extends selection instead of 118 showing the popup-menu: >vim 119 set mousemodel=extend 120 - Map <A-LeftMouse> so that it temporarily disables mouse until the cursor 121 moves: >vim 122 nnoremap <A-LeftMouse> <Cmd> 123 \ set mouse=<Bar> 124 \ echo 'mouse OFF until next cursor-move'<Bar> 125 \ autocmd CursorMoved * ++once set mouse&<Bar> 126 \ echo 'mouse ON'<CR> 127 < 128 To remove the default popup-menu without disabling mouse: >vim 129 aunmenu PopUp 130 autocmd! nvim.popupmenu 131 132 To remove only the "How-to disable mouse" menu item (and its separator): >vim 133 aunmenu PopUp.How-to\ disable\ mouse 134 aunmenu PopUp.-2- 135 136 DEFAULT MAPPINGS 137 *default-mappings* 138 Nvim creates the following default mappings at |startup|. You can disable any 139 of these in your config by simply removing the mapping, e.g. ":unmap Y". If 140 you never want any default mappings, call |:mapclear| early in your config. 141 142 - Y |Y-default| 143 - <C-U> |i_CTRL-U-default| 144 - <C-W> |i_CTRL-W-default| 145 - <C-L> |CTRL-L-default| 146 - & |&-default| 147 - Q |v_Q-default| 148 - @ |v_@-default| 149 - # |v_#-default| 150 - * |v_star-default| 151 - gc |gc-default| |v_gc-default| |o_gc-default| 152 - gcc |gcc-default| 153 - |gO| 154 - ]d |]d-default| 155 - [d |[d-default| 156 - [D |[D-default| 157 - ]D |]D-default| 158 - <C-W>d |CTRL-W_d-default| 159 - |[q| |]q| |[Q| |]Q| |[_CTRL-Q| |]_CTRL-Q| 160 - |[l| |]l| |[L| |]L| |[_CTRL-L| |]_CTRL-L| 161 - |[t| |]t| |[T| |]T| |[_CTRL-T| |]_CTRL-T| 162 - |[a| |]a| |[A| |]A| 163 - |[b| |]b| |[B| |]B| 164 - |[<Space>| |]<Space>| 165 - LSP defaults |lsp-defaults| 166 - K |K-lsp-default| 167 - |v_an| |v_in| 168 - gr prefix |gr-default| 169 - |gra| |gri| |grn| |grr| |grt| 170 - <C-S> |i_CTRL-S| 171 172 DEFAULT AUTOCOMMANDS 173 *default-autocmds* 174 Default autocommands exist in the following groups. Use ":autocmd! {group}" to 175 remove them and ":autocmd {group}" to see how they're defined. 176 177 nvim.terminal: 178 - BufReadCmd: Treats "term://" buffers as |terminal| buffers. |terminal-start| 179 - TermClose: A |terminal| buffer started with no arguments (which thus uses 180 'shell') and which exits with no error is closed automatically. 181 - TermRequest: The terminal emulator responds to OSC background and foreground 182 requests, indicating (1) a black background and white foreground when Nvim 183 option 'background' is "dark" or (2) a white background and black foreground 184 when 'background' is "light". While this may not reflect the actual 185 foreground/background color, it permits 'background' to be retained for a 186 nested Nvim instance running in the terminal emulator. 187 - TermRequest: Nvim will create extmarks for shells which 188 annotate their prompts with OSC 133 escape sequences, enabling users to 189 quickly navigate between prompts using |[[| and |]]|. 190 - TermOpen: Sets default options and mappings for |terminal| buffers: 191 - 'nomodifiable' 192 - 'undolevels' set to -1 193 - 'textwidth' set to 0 194 - 'nowrap' 195 - 'nolist' 196 - 'nonumber' 197 - 'norelativenumber' 198 - 'signcolumn' set to "no" 199 - 'foldcolumn' set to "0" 200 - 'winhighlight' uses |hl-StatusLineTerm| and |hl-StatusLineTermNC| in 201 place of |hl-StatusLine| and |hl-StatusLineNC| 202 - |[[| and |]]| to navigate between shell prompts 203 204 nvim.cmdwin: 205 - |CmdwinEnter|: Limits syntax sync to maxlines=1 in the |cmdwin|. 206 207 nvim.swapfile: 208 - |SwapExists|: Skips the swapfile prompt (sets |v:swapchoice| to "e") when the 209 swapfile is owned by a running Nvim process. Shows |W325| "Ignoring 210 swapfile…" message. 211 212 nvim.exrc: 213 - |VimEnter|: Extend 'exrc' to also search for project-local configuration files 214 in all parent directories. 215 216 nvim.progress: 217 - |Progress|: Display native progress bars in the TUI using the OSC 9;4 escape 218 sequence. 219 220 ============================================================================== 221 New Features *nvim-features* 222 223 MAJOR COMPONENTS 224 225 - API |API| 226 - Job control |job-control| 227 - LSP framework |lsp| 228 - Lua scripting |lua| 229 - Parsing engine |treesitter| 230 - Plugin manager |vim.pack| 231 - Providers 232 - Clipboard |provider-clipboard| 233 - Node.js plugins |provider-nodejs| 234 - Python plugins |provider-python| 235 - Ruby plugins |provider-ruby| 236 - Remote plugins |remote-plugin| 237 - Shared data |shada| 238 - Terminal emulator |terminal| 239 - UI |ui| |--listen| |--server| 240 - Vimscript parser |nvim_parse_expression()| 241 - XDG base directories |xdg| 242 243 USER EXPERIENCE 244 245 Working intuitively and consistently is a major goal of Nvim. 246 247 *feature-compile* 248 - Nvim always includes ALL features, in contrast to Vim (which ships various 249 combinations of 100+ optional features). |feature-compile| Think of it as 250 a leaner version of Vim's "HUGE" build. This reduces surface area for bugs, 251 and removes a common source of confusion and friction for users. 252 253 - Nvim avoids features that cannot be provided on all platforms; instead that 254 is delegated to external plugins/extensions. E.g. the `-X` platform-specific 255 option is "sometimes" available in Vim (with potential surprises: 256 https://stackoverflow.com/q/14635295). 257 258 - Vim's internal test functions (test_autochdir(), test_settime(), etc.) are 259 not exposed (nor implemented); instead Nvim has a robust API. 260 261 - Behaviors, options, documentation are removed if they cost users more time 262 than they save. 263 264 Usability details have been improved where the benefit outweighs any 265 backwards-compatibility cost. Some examples: 266 267 - Directories for 'directory' and 'undodir' are auto-created. 268 - Terminal features such as 'guicursor' are enabled where possible. 269 - Various "nvim" |cli-arguments| were redesigned. 270 271 Some features are built in that otherwise required external plugins: 272 273 - Highlighting the yanked region, see |vim.hl|. 274 275 ARCHITECTURE 276 277 The Nvim UI is "decoupled" from the core editor: all UIs, including the 278 builtin |TUI| are just plugins that connect to a Nvim server (via |--server| 279 or |--embed|). Multiple Nvim UI clients can connect to the same Nvim editor 280 server. 281 282 External plugins run in separate processes. |remote-plugin| This improves 283 stability and allows those plugins to work without blocking the editor. Even 284 "legacy" Python and Ruby plugins which use the old Vim interfaces (|if_pyth|, 285 |if_ruby|) run out-of-process, so they cannot crash Nvim. 286 287 Platform and I/O facilities are built upon libuv. Nvim benefits from libuv 288 features and bug fixes, and other projects benefit from improvements to libuv 289 by Nvim developers. 290 291 FEATURES 292 293 Command-line: 294 - The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted 295 using a built-in Vimscript expression parser. |expr-highlight| 296 - *E5408* *E5409* |input()|, |inputdialog()| support custom highlighting. 297 |input()-highlight| 298 - (Experimental) *g:Nvim_color_cmdline* Command-line (|:|) is colored by 299 callback defined in `g:Nvim_color_cmdline` (this callback is for testing 300 only, and will be removed in the future). 301 302 Commands: 303 - |:checkhealth| 304 - |:connect| 305 - |:detach| 306 - |:drop| is always available 307 - |:EditQuery| 308 - |:Inspect| 309 - |:InspectTree| 310 - |:lsp| 311 - |:Man| is available by default, with many improvements such as completion 312 - |:match| can be invoked before highlight group is defined 313 - |:restart| 314 - |:source| works with Lua 315 - |:trust| 316 - User commands can support |:command-preview| to show results as you type 317 - |:write| with "++p" flag creates parent directories. 318 - |:update| command writes new file buffers even when unmodified. 319 320 Editor: 321 - |prompt-buffer| supports multiline input/paste, undo/redo, and o/O normal 322 commands. 323 - |i_CTRL-R| inserts named/clipboard registers (A-Z,a-z,0-9+) literally, like 324 pasting instead of like user input. Improves performance, avoids broken 325 formatting. To get the old behavior you can use `<C-R>=@x`. 326 327 Events (autocommands): 328 - Fixed inconsistent behavior in execution of nested autocommands #23368 329 - |BufModifiedSet| 330 - |Progress| 331 - |RecordingEnter| 332 - |RecordingLeave| 333 - |SearchWrapped| 334 - |Signal| 335 - |TabNewEntered| 336 - |TermClose| 337 - |TermOpen| 338 - |TermRequest| 339 - |TermResponse| is fired for DCS, OSC, and APC sequences received from the terminal, 340 in addition to the Primary Device Attributes response. |v:termresponse| 341 - |UIEnter| 342 - |UILeave| 343 344 Functions: 345 - |dictwatcheradd()| notifies a callback whenever a |Dict| is modified 346 - |dictwatcherdel()| 347 - |menu_get()| 348 - |msgpackdump()|, |msgpackparse()| provide msgpack de/serialization 349 - |stdpath()| 350 - |system()|, |systemlist()| can run {cmd} directly (without 'shell') 351 - |matchadd()| can be called before highlight group is defined 352 - |tempname()| tries to recover if the Nvim |tempdir| disappears. 353 - |writefile()| with "p" flag creates parent directories. 354 - |prompt_getinput()| 355 356 Highlight groups: 357 - |highlight-blend| controls blend level for a highlight group 358 - |expr-highlight| highlight groups (prefixed with "Nvim") 359 - |hl-NormalFloat| highlights floating window 360 - |hl-FloatBorder| highlights border of a floating window 361 - |hl-FloatTitle| highlights title of a floating window 362 - |hl-FloatFooter| highlights footer of a floating window 363 - |hl-NormalNC| highlights non-current windows 364 - |hl-MsgArea| highlights messages/cmdline area 365 - |hl-MsgSeparator| highlights separator for scrolled messages 366 - |hl-OkMsg| 367 - |hl-StderrMsg| 368 - |hl-StdoutMsg| 369 - |hl-Substitute| 370 - |hl-TermCursor| 371 - |hl-WinSeparator| highlights window separators 372 - |hl-Whitespace| highlights 'listchars' whitespace 373 - |hl-WinBar| highlights 'winbar' 374 - |hl-WinBarNC| highlights non-current window 'winbar' 375 376 Input/Mappings: 377 - ALT (|META|) chords always work (even in the |TUI|). Map |<M-| with any key: 378 <M-1>, <M-BS>, <M-Del>, <M-Ins>, <M-/>, <M-\>, <M-Space>, <M-Enter>, etc. 379 - Case-sensitive: <M-a> and <M-A> are two different keycodes. 380 - ALT may behave like <Esc> if not mapped. |i_ALT| |v_ALT| |c_ALT| 381 382 Normal commands: 383 - |gO| shows a filetype-defined "outline" of the current buffer. 384 - |Q| replays the last recorded macro instead of switching to Ex mode (|gQ|). 385 386 Options: 387 388 - `:set {option}<` removes local value for all |global-local| options. 389 - `:setlocal {option}<` copies global value to local value for all options. 390 - 'ambiwidth' cannot be set to empty. 391 - 'autoread' works in the terminal (if it supports "focus" events) 392 - 'background' cannot be set to empty. 393 - 'cpoptions' flags: |cpo-_| 394 - 'eadirection' cannot be set to empty. 395 - 'exrc' searches for ".nvim.lua", ".nvimrc", or ".exrc" files. The 396 user is prompted whether to trust the file. 397 - 'fileformat' cannot be set to empty. 398 - 'fillchars' flags: "msgsep", "horiz", "horizup", "horizdown", 399 "vertleft", "vertright", "verthoriz" 400 - 'foldcolumn' supports up to 9 dynamic/fixed columns 401 - 'guicursor' works in the terminal (TUI) 402 - 'inccommand' shows interactive results for |:substitute|-like commands 403 and |:command-preview| commands 404 - 'jumpoptions' 405 - "view" tries to restore |mark-view| when moving through the jumplist. 406 - "clean" removes unloaded buffers from the jumplist. 407 - the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|. 408 - 'laststatus' global statusline support 409 - 'mousemodel' cannot be set to empty. 410 - 'mousescroll' amount to scroll by when scrolling with a mouse 411 - 'pumblend' pseudo-transparent popupmenu 412 - 'scrollback' 413 - 'shortmess' 414 - "F" flag does not affect output from autocommands. 415 - "q" flag fully hides macro recording message. 416 - 'showcmdloc' cannot be set to empty. 417 - 'signcolumn' can show multiple signs (dynamic or fixed columns) 418 - 'statuscolumn' full control of columns using 'statusline' format 419 - 'statusline' default is exposed as a statusline expression. 420 - 'splitkeep' cannot be set to empty. 421 - 'tabline' middle-click on tabpage label closes tabpage, 422 and %@Func@foo%X can call any function on mouse-click 423 - 'termpastefilter' 424 - 'ttimeout', 'ttimeoutlen' behavior was simplified 425 - 'winblend' pseudo-transparency in floating windows |api-floatwin| 426 - 'winhighlight' window-local highlights 427 - 'busy' busy status for buffers 428 429 Performance: 430 - Signs are implemented using Nvim's internal "marktree" (btree) structure. 431 - Folds are not updated during insert-mode. 432 433 Providers: 434 - If a Python interpreter is available on your `$PATH`, |:python| and 435 |:python3| are always available. See |provider-python|. 436 437 Shell: 438 - Shell output (|:!|, |:make|, …) is always routed through the UI, so it 439 cannot "mess up" the screen. (You can still use "chansend(v:stderr,…)" if 440 you want to mess up the screen :) 441 - Nvim throttles (skips) messages from shell commands (|:!|, |:grep|, |:make|) 442 if there is too much output. No data is lost, this only affects display and 443 improves performance. |:terminal| output is never throttled. 444 - |:!| does not support "interactive" commands. Use |:terminal| instead. 445 (GUI Vim has a similar limitation, see ":help gui-pty" in Vim.) 446 - :!start is not special-cased on Windows. 447 - |system()| does not support writing/reading "backgrounded" commands. |E5677| 448 449 Signs: 450 - 'signcolumn' can show multiple signs. 451 - Signs are removed if the associated line is deleted. 452 - Signs placed twice with the same identifier in the same group are moved. 453 454 Startup: 455 - |-e| and |-es| invoke the same "improved Ex mode" as -E and -Es. 456 - |-E| and |-Es| read stdin as text (into buffer 1). 457 - |-es| and |-Es| have improved behavior: 458 - Quits automatically, don't need "-c qa!". 459 - Skips swap-file dialog. 460 - Optimized for non-interactive scripts: disables swapfile, shada. 461 - |-l| Executes Lua scripts non-interactively. 462 - |-s| reads Normal commands from stdin if the script name is "-". 463 - Reading text (instead of commands) from stdin |--|: 464 - works by default: "-" file is optional 465 - works in more cases: |-Es|, file args 466 467 TUI: 468 *:set-termcap* 469 - Start Nvim with 'verbose' level 3 to show terminal capabilities: > 470 nvim -V3 471 < 472 *'term'* *E529* *E530* *E531* 473 - 'term' reflects the terminal type derived from |$TERM| and other environment 474 checks. Use `:echo &term` to get its value. For debugging only; not 475 reliable during startup. 476 - Note: If you want to detect when Nvim is running in a terminal, use 477 `has('gui_running')` |has()| or see |nvim_list_uis()| for an example of 478 how to inspect the UI channel. 479 - Nvim might optionally be compiled with unibilium, in which case the terminfo 480 database will be used. Otherwise, or if the terminal was not found in 481 the database, a table of builtin terminal definitions will be used. 482 - Nvim will use 256-colour capability on Linux virtual terminals. Vim uses 483 only 8 colours plus bright foreground on Linux VTs. 484 - Vim combines what is in its |builtin-terms| with what it reads from terminfo, 485 and has a 'ttybuiltin' setting to control how that combination works. Nvim 486 uses one or the other, it does not attempt to merge the two. 487 488 UI/Display: 489 - |Visual| selection highlights the character at cursor. |visual-use| 490 - messages: When showing messages longer than 'cmdheight', only 491 scroll the message lines, not the entire screen. The 492 separator line is decorated by |hl-MsgSeparator| and 493 the "msgsep" flag of 'fillchars'. *msgsep* 494 495 Variables: 496 - |v:progpath| is always absolute ("full") 497 - |v:windowid| is always available (for use by external UIs) 498 - |OptionSet| autocommand args |v:option_new|, |v:option_old|, 499 - |v:option_oldlocal|, |v:option_oldglobal| have the type of the option 500 instead of always being strings. |v:option_old| is now the old global value 501 for all global-local options, instead of just string global-local options. 502 503 Vimscript: 504 - |:redir| nested in |execute()| works. 505 506 ============================================================================== 507 Upstreamed features *nvim-upstreamed* 508 509 These Nvim features were later integrated into Vim. 510 511 - 'diffopt' "linematch" feature 512 - 'fillchars' flags: "eob" 513 - 'jumpoptions' "stack" behavior 514 - 'wildoptions' flags: "pum" enables popupmenu for wildmode completion 515 - |<Cmd>| 516 - |WinClosed| 517 - |WinScrolled| 518 - |:sign-define| "numhl" argument 519 - |:source| works with anonymous (no file) scripts 520 - 'statusline' supports unlimited alignment sections 521 - |vim-tutor-mode| 522 - Lua: `require()` also searches for modules in 'runtimepath'. 523 - Lua: vim.g, vim.w, vim.b, vim.t, vim.v, vim.fn, vim.call() 524 525 ============================================================================== 526 Other changes *nvim-changed* 527 528 This section documents various low-level behavior changes. 529 530 |mkdir()| behaviour changed: 531 - 1. Assuming /tmp/foo does not exist and /tmp can be written to 532 mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and 533 /tmp/foo/bar with 0700 permissions. Vim mkdir will create /tmp/foo with 534 0755. 535 - 2. If you try to create an existing directory with `'p'` (e.g. mkdir('/', 536 'p')) mkdir() will silently exit. In Vim this was an error. 537 - 3. mkdir() error messages now include strerror() text when mkdir fails. 538 539 |string()| and |:echo| behaviour changed: 540 - 1. No maximum recursion depth limit is applied to nested container 541 structures. 542 - 2. |string()| fails immediately on nested containers, not when recursion 543 limit was exceeded. 544 - 3. When |:echo| encounters duplicate containers like >vim 545 let l = [] 546 echo [l, l] 547 < it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is 548 only used for recursive containers. 549 - 4. |:echo| printing nested containers adds "@level" after "..." designating 550 the level at which recursive container was printed: |:echo-self-refer|. 551 Same thing applies to |string()| (though it uses construct like 552 "{E724@level}"), but this is not reliable because |string()| continues to 553 error out. 554 - 5. Stringifyed infinite and NaN values now use |str2float()| and can be 555 evaled back. 556 - 6. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in 557 nothing, E908, in Nvim it is internal error. 558 559 |json_decode()| behaviour changed: 560 - 1. It may output |msgpack-special-dict|. 561 - 2. |msgpack-special-dict| is emitted also in case of duplicate keys, while 562 in Vim it errors out. 563 - 3. It accepts only valid JSON. Trailing commas are not accepted. 564 565 |json_encode()| behaviour slightly changed: now |msgpack-special-dict| values 566 are accepted, but |v:none| is not. 567 568 Viminfo text files were replaced with binary (messagepack) |shada| files. 569 Additional differences: 570 571 - |shada-c| has no effect. 572 - |shada-s| now limits size of every item and not just registers. 573 - 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for 574 compatibility reasons. 575 - |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old 576 commands are still kept. 577 - ShaDa file format was designed with forward and backward compatibility in 578 mind. |shada-compatibility| 579 - Some errors make ShaDa code keep temporary file in-place for user to decide 580 what to do with it. Vim deletes temporary file in these cases. 581 |shada-error-handling| 582 - ShaDa file keeps search direction (|v:searchforward|), viminfo does not. 583 584 |printf()| returns something meaningful when used with `%p` argument: in Vim 585 it used to return useless address of the string (strings are copied to the 586 newly allocated memory all over the place) and fail on types which cannot be 587 coerced to strings. See |id()| for more details, currently it uses 588 `printf("%p", {expr})` internally. 589 590 |c_CTRL-R| pasting a non-special register into |cmdline| omits the last <CR>. 591 592 |CursorMoved| triggers when moving between windows. 593 594 Lua interface (|lua.txt|): 595 - `:lua print("a\0b")` will print `a^@b`, like with `:echomsg "a\nb"` . In Vim 596 that prints `a` and `b` on separate lines, exactly like 597 `:lua print("a\nb")` . 598 - `:lua error('TEST')` emits the error: > 599 E5108: Lua: [string "<Vimscript compiled string>"]:1: TEST 600 < whereas Vim emits only "TEST". 601 - Lua has direct access to Nvim |API| via `vim.api`. 602 603 Commands: 604 - |:doautocmd| does not warn about "No matching autocommands". 605 - |:wincmd| accepts a count. 606 - `:write!` does not show a prompt if the file was updated externally. 607 - |:=| does not accept |ex-flags|. With an arg it is equivalent to |:lua=| 608 609 Command-line: 610 - The meanings of arrow keys do not change depending on 'wildoptions'. 611 612 Functions: 613 - |input()| and |inputdialog()| support for each other’s features (return on 614 cancel and completion respectively) via dictionary argument (replaces all 615 other arguments if used), and "cancelreturn" can have any type if passed in 616 a dictionary. 617 - |input()| and |inputdialog()| support user-defined cmdline highlighting. 618 619 Highlight groups: 620 - |hl-ColorColumn|, |hl-CursorColumn| are lower priority than most other 621 groups 622 - |hl-CursorLine| is low-priority unless foreground color is set 623 - |hl-VertSplit| superseded by |hl-WinSeparator| 624 - Highlight groups names are allowed to contain `@` characters. 625 - It is an error to define a highlight group with a name that doesn't match 626 the regexp `[a-zA-Z0-9_.@-]*` (see |group-name|). 627 - |hl-StatusLineTerm| |hl-StatusLineTermNC| are implemented as 'winhighlight' 628 window-local highlights which are set by the default |TermOpen| handler. 629 - The |ins-completion-menu| has cascading highlight styles. |hl-PmenuSel| and 630 |hl-PmenuMatch| both inherit from |hl-Pmenu|, and |hl-PmenuMatchSel| 631 inherits highlights from both |hl-PmenuSel| and |hl-PmenuMatch|. 632 633 Macro (|recording|) behavior: 634 - Replay of a macro recorded during :lmap produces the same actions as when it 635 was recorded. In Vim if a macro is recorded while using :lmap'ped keys then 636 the behaviour during record and replay differs. 637 - 'keymap' is implemented via :lmap instead of :lnoremap so that you can use 638 macros and 'keymap' at the same time. This also means you can use |:imap| on 639 the results of keys from 'keymap'. 640 641 Mappings: 642 - Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an 643 existing mapping for its simplified form (e.g. <Tab>). 644 - "#" followed by a digit doesn't stand for a function key at the start of the 645 lhs of a mapping. 646 647 Motion: 648 - The |jumplist| avoids useless/phantom jumps. 649 650 Syntax highlighting: 651 - syncolor.vim has been removed. Nvim now sets up default highlighting groups 652 automatically for both light and dark backgrounds, regardless of whether or 653 not syntax highlighting is enabled. This means that |:syntax-on| and 654 |:syntax-enable| are now identical. Users who previously used an 655 after/syntax/syncolor.vim file should transition that file into a 656 colorscheme. |:colorscheme| 657 658 Vimscript compatibility: 659 - `count` does not alias to |v:count| 660 - `errmsg` does not alias to |v:errmsg| 661 - `shell_error` does not alias to |v:shell_error| 662 - `this_session` does not alias to |v:this_session| 663 664 Working directory (Vim implemented some of these after Nvim): 665 - |DirChanged| and |DirChangedPre| can be triggered when switching to another 666 window or tab. 667 - |getcwd()| and |haslocaldir()| may throw errors if the tab page or window 668 cannot be found. *E5000* *E5001* *E5002* 669 - |haslocaldir()| checks for tab-local directory if and only if -1 is passed as 670 window number, and its only possible returns values are 0 and 1. 671 - `getcwd(-1)` is equivalent to `getcwd(-1, 0)` instead of returning the global 672 working directory. Use `getcwd(-1, -1)` to get the global working directory. 673 674 Options: 675 - 'titlestring' uses printf-style '%' items (see: 'statusline') to implement 676 the default behaviour. The implementation is equivalent to setting 677 'titlestring' to `%t%(\ %M%)%(\ \(%{expand(\"%:~:h\")}\)%)%a\ -\ Nvim`. 678 679 |packages|: 680 - "start" packages are not explicitly reported in 'runtimepath' (though they 681 are still searched for runtime files). See |runtime-search-path| 682 683 ============================================================================== 684 Missing features *nvim-missing* 685 686 These legacy Vim features are not yet implemented: 687 688 - *:gui* 689 - *:gvim* 690 - *'browsedir'* *'bsdir'* 691 - *'completepopup'* 692 - *'guioptions'* *'go'* 693 - *'guitablabel'* *'gtl'* 694 - *'guitabtooltip'* *'gtt'* 695 - *'mouseshape'* *'mouses'* 696 - *'previewpopup'* 697 698 ============================================================================== 699 Removed legacy features *nvim-removed* 700 701 These Vim features were intentionally removed from Nvim. 702 703 Aliases: 704 - ex (alias for "nvim -e") 705 - exim (alias for "nvim -E") 706 - gex (GUI) 707 - gview (GUI) 708 - gvim (GUI) 709 - gvimdiff (GUI) 710 - rgview (GUI) 711 - rgvim (GUI) 712 - rview 713 - rvim 714 - view (alias for "nvim -R") 715 - vimdiff (alias for "nvim -d" |diff-mode|) 716 717 Commands: 718 - :behave 719 - :fixdel 720 - *hardcopy* `:hardcopy` was removed. Instead, use `:TOhtml` and print the 721 resulting HTML using a web browser or other HTML viewer. 722 - :helpfind 723 - :mode (no longer accepts an argument) 724 - :open 725 - :Print 726 - :promptfind 727 - :promptrepl 728 - :scriptversion (always version 1) 729 - :shell 730 - :smile 731 - :tearoff 732 - :cstag 733 - :cscope 734 - :lcscope 735 - :scscope 736 - :Vimuntar 737 - `:TOhtml` was replaced by a Lua version (with various differences) 738 739 Compile-time features: 740 - Emacs tags support 741 - X11 integration (see |x11-selection|) 742 743 Editor: 744 - *cscope* support was removed in favour of plugin-based solutions such as: 745 https://github.com/dhananjaylatkar/cscope_maps.nvim 746 - *popup-window* : Use |floating-windows| instead. 747 - *spellfile.vim* : Replaced by |spellfile.lua|. 748 - *textprop* : Use |extmarks| instead. 749 750 Eval: 751 - *Vim9script* (the Vim 9+ flavor of Vimscript) is not supported. 752 - *cscope_connection()* 753 - *err_teapot()* 754 - *js_encode()* 755 - *js_decode()* 756 - *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead. 757 - *v:sizeofint* 758 - *v:sizeoflong* 759 - *v:sizeofpointer* 760 761 Events: 762 - *SafeStateAgain* 763 - *SigUSR1* Use |Signal| to detect `SIGUSR1` signal instead. 764 765 Options: 766 - *'aleph'* *'al'* 767 - antialias 768 - 'backspace' no longer supports number values. Instead: 769 - for `backspace=0` set `backspace=` (empty) 770 - for `backspace=1` set `backspace=indent,eol` 771 - for `backspace=2` set `backspace=indent,eol,start` (default behavior in Nvim) 772 - for `backspace=3` set `backspace=indent,eol,nostop` 773 - *'balloondelay'* *'bdlay'* 774 - *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'* 775 - *'balloonexpr'* *'bexpr'* 776 - bioskey (MS-DOS) 777 - conskey (MS-DOS) 778 - *'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".) 779 - 'cpoptions' (gjpkHw<*- and all POSIX flags were removed) 780 - *'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation) 781 - cscopepathcomp 782 - cscopeprg 783 - cscopequickfix 784 - cscoperelative 785 - cscopetag 786 - cscopetagorder 787 - cscopeverbose 788 - *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'* 789 - 'encoding' ("utf-8" is always used) 790 - esckeys 791 - 'guioptions' "t" flag was removed 792 - *'guifontset'* *'gfs'* (Use 'guifont' instead.) 793 - *'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.) 794 - 'highlight' (Names of builtin |highlight-groups| cannot be changed.) 795 - *'hkmap'* *'hk'* use `set keymap=hebrew` instead. 796 - *'hkmapp'* *'hkp'* use `set keymap=hebrewp` instead. 797 - keyprotocol 798 - *'pastetoggle'* *'pt'* Just Paste It.™ |paste| is handled automatically when 799 you paste text using your terminal's or GUI's paste feature (CTRL-SHIFT-v, 800 CMD-v (macOS), middle-click, …). 801 - *'imactivatefunc'* *'imaf'* 802 - *'imactivatekey'* *'imak'* 803 - *'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'* 804 - *'imdisable'* *'imd'* *'noimdisable'* *'noimd'* 805 - *'imstatusfunc'* *'imsf'* 806 - *'insertmode'* *'im'* Use the following script to emulate 'insertmode': >vim 807 autocmd BufWinEnter * startinsert 808 inoremap <Esc> <C-X><C-Z><C-]> 809 inoremap <C-C> <C-X><C-Z> 810 inoremap <C-L> <C-X><C-Z><C-]><Esc> 811 inoremap <C-Z> <C-X><C-Z><Cmd>suspend<CR> 812 noremap <C-C> <Esc> 813 snoremap <C-C> <Esc> 814 noremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR> 815 cnoremap <C-\><C-G> <C-\><C-N><Cmd>startinsert<CR> 816 inoremap <C-\><C-G> <C-X><C-Z> 817 autocmd CmdwinEnter * noremap <buffer> <C-C> <C-C> 818 autocmd CmdwinEnter * inoremap <buffer> <C-C> <C-C> 819 820 lua << EOF 821 vim.on_key(function(c) 822 if c == '\27' then 823 local mode = vim.api.nvim_get_mode().mode 824 if mode:find('^[nvV\22sS\19]') and vim.fn.getcmdtype() == '' then 825 vim.schedule(function() 826 vim.cmd('startinsert') 827 end) 828 end 829 end 830 end) 831 EOF 832 - *'macatsui'* 833 - *'maxcombine'* *'mco'* : Nvim counts maximum character sizes in bytes, not 834 codepoints. This is guaranteed to be big enough to always fit all chars 835 properly displayed in vim with 'maxcombine' set to 6. 836 - You can still edit text with larger characters than fits in the screen 837 buffer, you just can't see them. Use |g8| or |ga|. See |mbyte-combining|. 838 - NOTE: the rexexp engine still has a hard-coded limit of considering 839 6 composing chars only. 840 - *'maxmem'* Nvim delegates memory-management to the OS. 841 - *'maxmemtot'* Nvim delegates memory-management to the OS. 842 - *'opendevice'* *'odev'* *'noopendevice'* *'noodev'* 843 - printoptions 844 - *'printdevice'* 845 - *'printencoding'* 846 - *'printexpr'* 847 - *'printfont'* 848 - *'printheader'* 849 - *'printmbcharset'* 850 - *'prompt'* *'noprompt'* 851 - *'remap'* *'noremap'* 852 - *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* 853 - *'secure'* : Everything is allowed in 'exrc' files, because they must be 854 explicitly marked as "trusted". 855 - *'shelltype'* 856 - 'shortmess' flags: *shm-f* *shm-n* *shm-x* *shm-i* (behave like always on) 857 - *'shortname'* *'sn'* *'noshortname'* *'nosn'* 858 - *'swapsync'* *'sws'* 859 - *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows) 860 - *'terse'* *'noterse'* (Add "s" to 'shortmess' instead) 861 - textauto 862 - textmode 863 - *'toolbar'* *'tb'* 864 - *'toolbariconsize'* *'tbis'* 865 - *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* 866 - *'ttyfast'* *'tf'* *'nottyfast'* *'notf'* 867 - *'ttymouse'* *'ttym'* 868 - *'ttyscroll'* *'tsl'* 869 - *'ttytype'* *'tty'* 870 - weirdinvert 871 872 Plugins: 873 - logiPat 874 - rrhelper 875 - *vimball* 876 - shellmenu 877 - macmap.vim 878 - tools/check_colors.vim 879 - macros/{justify,matchit,swapmous}.vim: use `packadd! justify` etc. 880 directly 881 - HelpToc: Use |gO| instead. 882 883 Providers: 884 - *if_lua* : Nvim |Lua| API is not compatible with Vim's "if_lua". 885 - *if_mzscheme* 886 - |if_pyth|: *python-bindeval* *python-Function* are not supported. 887 - *if_tcl* 888 889 Startup: 890 - `--literal`: File args are always literal; to expand wildcards on Windows, 891 use |:n| e.g. `nvim +"n *"` 892 - Easy mode: eview, evim, nvim -y 893 - Restricted mode: rview, rvim, nvim -Z 894 - Vi mode: nvim -v 895 896 Test functions: 897 - test_alloc_fail() 898 - test_autochdir() 899 - test_feedinput() 900 - test_garbagecollect_soon() 901 - test_getvalue() 902 - test_ignore_error() 903 - test_null_blob() 904 - test_null_channel() 905 - test_null_dict() 906 - test_null_function() 907 - test_null_job() 908 - test_null_list() 909 - test_null_partial() 910 - test_null_string() 911 - test_option_not_set() 912 - test_override() 913 - test_refcount() 914 - test_scrollbar() 915 - test_setmouse() 916 - test_settime() 917 - test_srand_seed() 918 - test_unknown() 919 - test_void() 920 921 TUI: 922 *t_xx* *termcap-options* *t_AB* *t_Sb* *t_vb* *t_SI* 923 - Nvim does not have special `t_XX` options nor <t_XX> keycodes to configure 924 terminal capabilities. Instead Nvim treats the terminal as any other UI, 925 e.g. 'guicursor' sets the terminal cursor style if possible. 926 927 *termcap* 928 - Nvim never uses the termcap database, only |terminfo| and |builtin-terms|. 929 930 *xterm-8bit* *xterm-8-bit* 931 - Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this 932 requires autodetection of whether the terminal is in UTF-8 mode or non-UTF-8 933 mode, as the 8-bit CSI character has to be written differently in each case. 934 Vim issues a "request version" sequence to the terminal at startup and looks 935 at how the terminal is sending CSI. Nvim does not issue such a sequence and 936 always uses 7-bit control sequences. 937 938 vim:tw=78:ts=8:sw=2:et:ft=help:norl: