news.txt (22329B)
1 *news.txt* Nvim 2 3 4 NVIM REFERENCE MANUAL 5 6 7 Notable changes since Nvim 0.11 *news* 8 9 For changes in the previous release, see |news-0.11|. 10 11 Type |gO| to see the table of contents. 12 13 ============================================================================== 14 BREAKING CHANGES IN HEAD OR EXPERIMENTAL *news-breaking-dev* 15 16 ====== Remove this section before release. ====== 17 18 The following changes to UNRELEASED features were made during the development 19 cycle (Nvim HEAD, the "master" branch). 20 21 EVENTS 22 23 • Renamed "nvim.find_exrc" |default-autocmds| group to "nvim.exrc". 24 25 EXPERIMENTS 26 27 • todo 28 29 LSP 30 31 • |vim.lsp.buf.selection_range()| now accepts an integer which specifies its 32 direction, rather than a string `'outer'` or `'inner'`. 33 34 OPTIONS 35 36 • `'completefuzzycollect'` and `'isexpand'` have been removed. 37 38 TREESITTER 39 40 • todo 41 42 UI 43 44 • `progress` attribute removed from |ui-messages| msg_show event 45 46 VIMSCRIPT 47 48 • `complete_match()` has been removed. 49 50 ============================================================================== 51 BREAKING CHANGES *news-breaking* 52 53 These changes may require adaptations in your config or plugins. 54 55 API 56 57 • Decoration provider has `on_range()` callback. 58 • |nvim_get_commands()| returns `complete` as a Lua function, if it was 59 defined as such. 60 61 BUILD 62 63 • todo 64 65 DIAGNOSTICS 66 67 • |diagnostic-signs| can no longer be configured with |:sign-define| or 68 |sign_define()| (deprecated in Nvim 0.10 |deprecated-0.10|). 69 • |vim.diagnostic.disable()| and |vim.diagnostic.is_disabled()| (deprecated in 70 Nvim 0.10 |deprecated-0.10|) are removed. 71 • The legacy signature of |vim.diagnostic.enable()| (deprecated in Nvim 0.10 72 |deprecated-0.10|) is no longer supported. 73 74 EDITOR 75 76 • |i_CTRL-R| inserts named/clipboard registers (A-Z,a-z,0-9+) literally, like 77 pasting instead of like user input. Improves performance, avoids broken 78 formatting. To get the old behavior you can use `<C-R>=@x`. 79 • Buffer name URI scheme parsing more closely follows RFC3986, so for example 80 "svn+ssh:", "ed2k:", and "iris.xpc:" are recognized as URI schemes. 81 • On Windows, Nvim no longer searches the current directory for executables 82 for running external commands; prefix a relative or absolute path if you 83 want the old behavior |$NoDefaultCurrentDirectoryInExePath|. 84 85 EVENTS 86 87 • |ui-messages| no longer emits the `msg_show.return_prompt`, and 88 `msg_history_clear` events. The `msg_clear` event was repurposed and is now 89 emitted after the screen is cleared. These events arbitrarily assumed a 90 message UI that mimics the legacy message grid. Benefit: reduced UI event 91 traffic and more flexibility for UIs. 92 The `msg_history_show` event has an additional "prev_cmd" argument. 93 94 HIGHLIGHTS 95 96 • todo 97 98 LSP 99 100 • JSON "null" values in LSP messages are represented as |vim.NIL| instead of `nil`. 101 Missing fields (as opposed to JSON "null") are still represented as `nil`. 102 • The function set with |vim.lsp.log.set_format_func()| is now given all 103 arguments corresponding to a log entry instead of the individual arguments. 104 • Renamed `vim.lsp.semantic_tokens` `start()/stop()` to `enable()`. 105 • |vim.lsp.util.convert_signature_help_to_markdown_lines()| activeParameter 106 handling updated: 107 • Values < 0 are now treated as `nil` instead of 0. 108 • Values outside the range of `signatures[activeSignature].parameters` 109 are now treated as `nil` instead of `#signatures[activeSignature].parameters` 110 111 LUA 112 113 • Renamed `vim.diff` to `vim.text.diff`. 114 115 OPTIONS 116 117 • 'shelltemp' defaults to "false". 118 119 PLUGINS 120 121 • Removed "shellmenu" plugin, an old menu-based quasi-snippet plugin for shell scripts. 122 123 TREESITTER 124 125 • The |vim.treesitter.query.lint()| is no longer enabled by default in the 126 |ft-query-plugin|. 127 • |treesitter-directive-offset!| can now be applied to quantified captures. It 128 no longer sets `metadata[capture_id].range`; it instead sets 129 `metadata[capture_id].offset`. The offset will be applied in 130 |vim.treesitter.get_range()|, which should be preferred over reading 131 metadata directly for retrieving node ranges. 132 133 TUI 134 135 • todo 136 137 VIMSCRIPT 138 139 • todo 140 141 ============================================================================== 142 NEW FEATURES *news-features* 143 144 The following new features were added. 145 146 API 147 148 • |api-contract| allows existing functions to change return-type from `void => non-void`. 149 • |nvim_win_text_height()| can limit the lines checked when a certain 150 `max_height` is reached, and returns the `end_row` and `end_vcol` for which 151 `max_height` or the calculated height is reached. 152 • |vim.secure.read()| now returns `true` for trusted directories. Previously 153 it would return `nil`, which made it impossible to tell if the directory was 154 actually trusted. 155 • Added |vim.lsp.is_enabled()| to check if a given LSP config has been enabled 156 by |vim.lsp.enable()|. 157 • |nvim_ui_send()| writes arbitrary data to a UI's stdout. Use this to write 158 escape sequences to the terminal when Nvim is running in the |TUI|. 159 • |nvim_echo()| can set the |ui-messages| kind with which to emit the message. 160 • |nvim_echo()| can create |Progress| messages 161 • |nvim_get_commands()| returns `preview` and `callback` as Lua functions if 162 they were so specified in `nvim_create_user_command()`. 163 • |nvim_open_win()| floating windows can show a 'statusline'. Plugins can use 164 `style='minimal'` or `:setlocal statusline=` to hide the statusline. 165 • Added experimental |nvim__exec_lua_fast()| to allow remote API clients to 166 execute code while nvim is blocking for input. 167 • |vim.secure.trust()| accepts `path` for the `allow` action. 168 169 BUILD 170 171 • A Zig-based build system has been added as an alternative to CMake. It is 172 currently limited in functionality, and CMake remains the recommended option 173 for the time being. 174 • Nvim can be built without Unibilium (terminfo implementation), in which case 175 the user's terminfo database won't be loaded and only internal definitions 176 for the most common terminals are used: > 177 178 make distclean && make CMAKE_EXTRA_FLAGS="-DENABLE_UNIBILIUM=0" DEPS_CMAKE_FLAGS"-DUSE_BUNDLED_UNIBILIUM=0" 179 < 180 • On Windows, `tee.exe` is installed with `nvim.exe` by default so that 181 commands like :make, :grep work out of the box. 182 183 DEFAULTS 184 185 • 'diffopt' default value now includes "indent-heuristic" and "inline:char". 186 • 'statusline' default is exposed as a statusline expression (previously it 187 was implemented as an internal C routine). 188 • 'statusline' includes |vim.diagnostic.status()| 189 • Project-local configuration ('exrc') is also loaded from parent directories. 190 Unset 'exrc' to stop further search. 191 • Mappings: 192 • |grt| in Normal mode maps to |vim.lsp.buf.type_definition()| 193 • 'shada' default now excludes "/tmp/" and "/private/" paths to reduce clutter in |:oldfiles|. 194 • Enabled treesitter highlighting for Markdown files 195 196 DIAGNOSTICS 197 198 • |vim.diagnostic.setloclist()| and |vim.diagnostic.setqflist()| now support a 199 `format` function to modify (or filter) diagnostics before being set in the 200 location/quickfix list. 201 • |vim.diagnostic.get()| now accepts an `enabled` filter to only return 202 enabled or disabled diagnostics. 203 • |vim.diagnostic.status()| returns a formatted string with current buffer 204 diagnostics 205 • |vim.diagnostic.fromqflist()| now accepts an `opts` table with 206 `merge_lines` to merge multi-line compiler messages. 207 208 EDITOR 209 210 • |:iput| works like |:put| but adjusts indent. 211 • |:retab| accepts new optional parameter -indentonly to only change leading 212 whitespace in indented lines. 213 • |:uniq| deduplicates text in the current buffer. 214 • |omnicompletion| in `help` buffer. |ft-help-omni| 215 • Setting "'0" in 'shada' prevents storing the jumplist in the shada file. 216 • 'shada' now correctly respects "/0" and "f0". 217 • |prompt-buffer| supports multiline input/paste, undo/redo, and o/O normal 218 commands. 219 • 'wildchar' now enables completion in search contexts using |/|, |?|, |:g|, |:v| 220 and |:vimgrep| commands. 221 • For security, 'exrc' no longer shows an "(a)llow" choice. Instead you must 222 "(v)iew" then run `:trust`. 223 • |gx| in help buffers opens the online documentation for the tag under the 224 cursor. 225 • |:source| with a range in non-Lua files (e.g., vimdoc) now detects Lua 226 codeblocks via treesitter and executes them as Lua instead of Vimscript. 227 • |:Undotree| for visually navigating the |undo-tree| 228 • |:wall| permits a |++p| option for creating parent directories when writing 229 changed buffers. 230 • The |:DiffTool| command compares directories (and files). 231 232 EVENTS 233 234 • A new `empty` message kind is emitted for an empty (e.g. `:echo ""`) message. 235 • |CmdlineLeave| sets |v:char| to the character that stops the Cmdline mode. 236 • |CmdlineLeavePre| triggered before preparing to leave the command line. 237 • New `append` parameter for |ui-messages| `msg_show` event. 238 • New `msg_id` parameter for |ui-messages| `msg_show` event. 239 • 'rulerformat' is emitted as `msg_ruler` when not part of the statusline. 240 • Creating or updating a progress message with |nvim_echo()| triggers a |Progress| event. 241 • |MarkSet| is triggered after a |mark| is set by the user (currently doesn't 242 support implicit marks like |'[| or |'<|, …). 243 • |SessionLoadPre| is triggered before loading a |Session| file. 244 • |TabClosedPre| is triggered before closing a |tabpage|. 245 • New `terminator` parameter for |TermRequest| event. 246 247 HIGHLIGHTS 248 249 • |hl-DiffTextAdd| highlights added text within a changed line. 250 • |hl-OkMsg| |hl-StderrMsg| |hl-StdoutMsg| 251 • |hl-SnippetTabstopActive| highlights the currently active tabstop. 252 • |hl-PmenuBorder| |hl-PmenuShadow| |hl-PmenuShadowThrough| see 'pumborder'. 253 • |nvim_set_hl()| and |nvim_get_hl()| support the SGR attributes "dim", 254 "blink", "conceal", and "overline". 255 256 LSP 257 258 • |:lsp| can be used to interactively manage LSP clients. 259 • |vim.lsp.ClientConfig| gained `workspace_required`. 260 • You can control the priority of |vim.lsp.Config| `root_markers`. 261 • Support for `textDocument/documentColor`: |lsp-document_color| 262 https://microsoft.github.io/language-server-protocol/specification/#textDocument_documentColor 263 • Support for `textDocument/colorPresentation |lsp-document_color| 264 https://microsoft.github.io/language-server-protocol/specification/#textDocument_colorPresentation 265 • The `textDocument/diagnostic` request now includes the previous id in its 266 parameters. 267 • |vim.lsp.enable()| start/stops clients as necessary and detaches 268 non-applicable LSP clients. 269 • |vim.lsp.is_enabled()| checks if a LSP config is enabled (without 270 "resolving" it). 271 • Support for `workspace/diagnostic`: |vim.lsp.buf.workspace_diagnostics()| 272 https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_dagnostics 273 • Incremental selection is now supported via `textDocument/selectionRange`. 274 `an` selects outwards and `in` selects inwards. 275 • Support for multiline semantic tokens. 276 • Support for the `disabled` field on code actions. 277 • The function form of `cmd` in a vim.lsp.Config or vim.lsp.ClientConfig 278 receives the resolved config as the second arg: `cmd(dispatchers, config)`. 279 • Support for annotated text edits. 280 • `:checkhealth vim.lsp` is now available to check which buffers the active LSP features are attached to. 281 • LSP `DiagnosticRelatedInformation` is now shown in 282 |vim.diagnostic.open_float()|. It is read from the LSP diagnostic object 283 stored in the `user_data` field. 284 • When inside the float created by |vim.diagnostic.open_float()| and the 285 cursor is on a line with `DiagnosticRelatedInformation`, |gf| can be used to 286 jump to the problematic location. 287 • Support for `textDocument/linkedEditingRange`: |lsp-linked_editing_range| 288 https://microsoft.github.io/language-server-protocol/specification/#textDocument_linkedEditingRange 289 • Support for related documents in pull diagnostics: 290 https://microsoft.github.io/language-server-protocol/specifications/specification-current/#relatedFullDocumentDiagnosticReport 291 • |vim.lsp.buf.signature_help()| supports "noActiveParameterSupport". 292 • Support for `textDocument/inlineCompletion` |lsp-inline_completion| 293 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_inlineCompletion 294 See |lsp-inline_completion| for quickstart instructions. 295 • Support for `textDocument/onTypeFormatting`: |lsp-on_type_formatting| 296 https://microsoft.github.io/language-server-protocol/specification/#textDocument_onTypeFormatting 297 • The filter option of |vim.lsp.buf.code_action()| now receives the client ID as an argument. 298 • |vim.lsp.ClientConfig| `exit_timeout` decides the time waited before "stop" 299 escalates to "force-stop" for |vim.lsp.enable()|, |Client:stop()|, and 300 during Nvim shutdown. 301 • `exit_timeout` graduated from "experimental" `flags.exit_timeout` 302 to a top-level field. Defaults to `false`. 303 • |Client:stop()| accepts `force` as an integer, which is treated as the time 304 to wait before before stop escalates to force-stop. 305 • Add cmp field to opts of |vim.lsp.completion.enable()| for custom completion ordering. 306 • Support for `workspace/diagnostic/refresh`: 307 https://microsoft.github.io/language-server-protocol/specification/#diagnostic_refresh 308 • Support for dynamic registration for `textDocument/diagnostic` 309 • |vim.lsp.buf.rename()| now highlights the symbol being renamed using the 310 |hl-LspReferenceTarget| highlight group. 311 • Support for `textDocument/semanticTokens/range`. 312 • Support for `textDocument/codeLens` |lsp-codelens| has been reimplemented: 313 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_codeLens 314 • Code lenses now display as virtual lines 315 • Support for `workspace/codeLens/refresh`: 316 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens_refresh 317 • `gx` will use `textDocument/documentLink` if available. 318 • |vim.lsp.completion.enable()| adds colored symbol preview for color items. 319 320 LUA 321 322 • |vim.net.request()| can fetch files via HTTP GET requests. 323 • |vim.wait()| returns the callback results. 324 • Lua type annotations for `vim.uv`. 325 • |vim.hl.range()| now allows multiple timed highlights. 326 • |vim.tbl_extend()| and |vim.tbl_deep_extend()| now accept a function behavior argument. 327 • |vim.fs.root()| can define "equal priority" via nested lists. 328 • |vim.version.range()| output can be converted to a human-readable string with |tostring()|. 329 • |vim.version.intersect()| computes intersection of two version ranges. 330 • |Iter:take()| and |Iter:skip()| now optionally accept predicates. 331 • |Iter:peek()| now works for all iterator types, not just |list-iterator|. 332 • Built-in plugin manager |vim.pack| 333 • |vim.list.unique()| and |Iter:unique()| to deduplicate lists and iterators, 334 respectively. 335 • |vim.list.bisect()| for binary search. 336 • Experimental `vim.pos` and `vim.range` for Position/Range abstraction. 337 • |vim.json.encode()| has an `indent` option for pretty-formatting. 338 • |vim.json.encode()| has an `sort_keys` option. 339 • |Range:is_empty()| to check if a |vim.Range| is empty. 340 • |vim.json.decode()| has an `skip_comments` option. 341 342 OPTIONS 343 344 • 'autocomplete' enables |ins-autocompletion|. 345 • 'autowriteall' writes all buffers upon receiving `SIGHUP`, `SIGQUIT` or `SIGTSTP`. 346 • 'chistory' and 'lhistory' set size of the |quickfix-stack|. 347 • 'complete' new flags: 348 • "F{func}" complete using given function 349 • "F" complete using 'completefunc' 350 • "o" complete using 'omnifunc' 351 • 'complete' allows limiting matches for sources using "{flag}^<limit>". 352 • 'completeopt' flag "nearest" sorts completion results by distance to cursor. 353 • 'diffanchors' specifies addresses to anchor a diff. 354 • 'diffopt' `inline:` configures diff highlighting for changes within a line. 355 • 'fillchars' has new flag "foldinner". 356 • 'fsync' and 'grepformat' are now |global-local| options. 357 • 'listchars' has new flag "leadtab". 358 • 'jumpoptions' flag "view" now applies when popping the |tagstack|. 359 • 'maxsearchcount' sets maximum value for |searchcount()| and defaults to 999. 360 • 'pummaxwidth' sets maximum width for the completion popup menu. 361 • 'winborder' "bold" style, custom border style. 362 • |g:clipboard| accepts a string name to force any builtin clipboard tool. 363 • 'busy' sets a buffer "busy" status. Indicated in the default statusline. 364 • 'pumborder' adds a border to the popup menu. 365 • |g:clipboard| autodetection only selects tmux when running inside tmux 366 • 'statusline' allows "stacking" highlight groups (groups inherit from 367 previous highlight attributes) 368 369 PERFORMANCE 370 371 • |vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that 372 provides ~50% speedup for complex patterns. The implementation restores 373 support for nested braces and follows LSP 3.17 specification with 374 additional constraints for improved correctness and resistance to 375 backtracking edge cases. 376 • |i_CTRL-R| inserts named/clipboard registers literally, 10x speedup. 377 • LSP `textDocument/semanticTokens/range` is supported, which requests tokens 378 for the viewport (visible screen) only. 379 • |:packadd| doesn't invalidate the cached Lua package path. Instead the cache 380 gets updated in place. This might make a big startuptime difference for 381 certain |init.lua| patterns where multiple |:packadd| or |vim.pack.add()| 382 calls are interspersed with other code. 383 384 PLUGINS 385 386 • Customize :checkhealth by handling a `FileType checkhealth` event. 387 |health-usage| 388 • Simplify Python provider setup to a single step: `uv tool install pynvim` 389 Nvim will detect the plugin's location without user configuration, even if 390 unrelated Python virtual environments are activated. 391 |provider-python| 392 • |:checkhealth| now checks for an available |vim.ui.open()| handler. 393 394 STARTUP 395 396 • todo 397 398 TERMINAL 399 400 • |nvim_open_term()| can be called with a non-empty buffer. The buffer 401 contents are piped to the PTY and displayed as terminal output. 402 • CSI 3 J (the sequence to clear terminal scrollback) is now supported. 403 • A suspended PTY process is now indicated by "[Process suspended]" at the 404 bottom-left of the buffer and can be resumed by pressing a key. 405 406 TREESITTER 407 408 • |Query:iter_captures()| supports specifying starting and ending columns. 409 • |:EditQuery| command gained tab-completion, works with injected languages. 410 • |LanguageTree:parse()| now accepts a list of ranges. 411 412 TUI 413 414 • |TermResponse| now supports DA1 and APC query responses. 415 • Native progress bars are displayed for |Progress| events using the OSC 9;4 416 sequence. 417 • The TUI now renders the SGR dim (faint), blink, conceal, and overline 418 attributes. 419 420 UI 421 422 • |ui2| is a redesign of the core messages and commandline UI, which will 423 replace the legacy message grid in the TUI. 424 • Avoids "Press ENTER" interruptions. 425 • Avoids delays from |W10| "Changing a readonly file" and other warnings. 426 • Highlights the cmdline as you type. 427 • Provides the |pager| as a buffer + window. 428 • Currently experimental. To enable it: `require('vim._core.ui2').enable()` 429 • |:restart| restarts Nvim and reattaches the current UI. 430 • |:connect| dynamically connects the current UI to the server at the given 431 address. 432 • |:checkhealth| shows a summary in the header for every healthcheck. 433 • |ui-multigrid| provides composition information and absolute coordinates. 434 • Error messages are more concise: 435 • "Error detected while processing:" changed to "Error in:". 436 • "Error executing Lua:" changed to "Lua:". 437 • 'busy' status is shown in default statusline with symbol ◐ 438 • Cursor shape indicates when it is behind an unfocused floating window. 439 • Improved LSP signature help rendering. 440 • Multigrid UIs can call nvim_input_mouse with grid 0 to let Nvim decide the grid. 441 442 VIMSCRIPT 443 444 • |chdir()| allows optionally specifying a scope argument. 445 • |cmdcomplete_info()| gets current cmdline completion info. 446 • |getcompletiontype()| gets command-line completion type for any string. 447 • |prompt_getinput()| gets current user-input in prompt-buffer. 448 • |wildtrigger()| triggers command-line expansion. 449 • |v:vim_did_init| is set after sourcing |init.vim| but before |load-plugins|. 450 451 ============================================================================== 452 CHANGED FEATURES *news-changed* 453 454 These existing features changed their behavior. 455 456 • 'pumblend' does not apply special attributes (bold, underline) from the 457 background layer to the foreground layer. 458 • |gv| works in operator pending mode and does not abort. 459 • 'smartcase' applies to completion filtering. 460 • 'spellfile' location defaults to `stdpath("data").."/site/spell/"` instead of 461 the first writable directory in 'runtimepath'. 462 • |vim.version.range()| doesn't exclude `to` if it is equal to `from`. 463 • |$VIM| and |$VIMRUNTIME| no longer check for Vim version-specific runtime 464 directory `vim{number}` (e.g. `vim82`). 465 • 'scrollback' maximum value increased from 100000 to 1000000 466 • |matchfuzzy()| and |matchfuzzypos()| use an improved fuzzy matching algorithm 467 (same as fzy). 468 • Windows: Paths like "\Windows" and "/Windows" are now considered to be 469 absolute paths (to the current drive) and no longer relative. 470 • When 'shelltemp' is off, shell commands now use `pipe()` and not `socketpair()` 471 for input and output. This matters mostly for Linux where some command lines 472 using "/dev/stdin" and similiar would break as these special files can be 473 reopened when backed by pipes but not when backed by socket pairs. 474 475 ============================================================================== 476 REMOVED FEATURES *news-removed* 477 478 These deprecated features were removed. 479 480 • todo 481 482 ============================================================================== 483 DEPRECATIONS *news-deprecations* 484 485 See |deprecated-0.12|. 486 487 vim:tw=78:ts=8:sw=2:et:ft=help:norl: