news.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. *news.txt* Nvim
  2. NVIM REFERENCE MANUAL
  3. Notable changes since Nvim 0.10 *news*
  4. For changes in the previous release, see |news-0.10|.
  5. Type |gO| to see the table of contents.
  6. ==============================================================================
  7. BREAKING CHANGES IN HEAD OR EXPERIMENTAL *news-breaking-dev*
  8. ====== Remove this section before release. ======
  9. The following changes to UNRELEASED features were made during the development
  10. cycle (Nvim HEAD, the "master" branch).
  11. EXPERIMENTS
  12. • Removed `vim.loader.disable()`. Use `vim.loader.enable(false)` instead.
  13. OPTIONS
  14. • 'jumpoptions' flag "unload" has been renamed to "clean".
  15. • The `msghistory` option has been removed in favor of 'messagesopt'.
  16. ==============================================================================
  17. BREAKING CHANGES *news-breaking*
  18. These changes may require adaptations in your config or plugins.
  19. API
  20. • Improved API "meta" docstrings and :help documentation.
  21. • `vim.rpcnotify(0)` and `rpcnotify(0)` broadcast to ALL channels. Previously
  22. they would "multicast" only to subscribed channels (controlled by
  23. `nvim_subscribe()`). Plugins and clients that want "multicast" behavior must
  24. now maintain their own list of channels.
  25. • In the future, |vim.rpcnotify()| may accept a list of channels, if there
  26. is demand for this use-case.
  27. • "Dictionary" was renamed to "Dict" internally and in the RPC |api-metadata|.
  28. This is not expected to break clients because there are no known clients
  29. that actually use the `return_type` field or the parameter type names
  30. reported by |--api-info| or |nvim_get_api_info()|.
  31. • |nvim_open_win()| supports a `mouse` field that allows configuring mouse
  32. interaction with the window separately from `focusable` field.
  33. • Renamed `nvim__id_dictionary` (unsupported/experimental API) to
  34. `nvim__id_dict`.
  35. BUILD
  36. On Windows, only building with the UCRT runtime is supported.
  37. DEFAULTS
  38. • |]d-default| and |[d-default| accept a count.
  39. • |[D-default| and |]D-default| jump to the first and last diagnostic in the
  40. current buffer, respectively.
  41. • 'number', 'relativenumber', 'signcolumn', and 'foldcolumn' are disabled in
  42. |terminal| buffers. See |terminal-config| for an example of changing these defaults.
  43. • |vim.json.encode()| no longer escapes the forward slash symbol by default
  44. DIAGNOSTICS
  45. • |vim.diagnostic.config()| accepts a "jump" table to specify defaults for
  46. |vim.diagnostic.jump()|.
  47. • The "underline" diagnostics handler sorts diagnostics by severity when using
  48. the "severity_sort" option.
  49. EDITOR
  50. • The order in which signs are placed was changed. Higher priority signs will
  51. now appear left of lower priority signs.
  52. • |hl-CurSearch| now behaves the same as Vim and no longer updates on every
  53. cursor movement.
  54. • Moving in the buffer list using |:bnext| and similar commands behaves as
  55. documented and skips help buffers if run from a non-help buffer, otherwise
  56. it moves to another help buffer.
  57. • Bells from a |terminal| buffer are now silent by default, unless 'belloff'
  58. option doesn't contain "term" or "all".
  59. EVENTS
  60. • |vim.ui_attach()| callbacks for |ui-messages| `msg_show` events are executed in
  61. |api-fast| context.
  62. LSP
  63. • Improved rendering of LSP hover docs. |K-lsp-default|
  64. • |vim.lsp.completion.enable()| gained the `convert` callback which enables
  65. customizing the transformation of an LSP CompletionItem to |complete-items|.
  66. • |vim.lsp.diagnostic.from()| can be used to convert a list of
  67. |vim.Diagnostic| objects into their LSP diagnostic representation.
  68. • |vim.lsp.buf.references()|, |vim.lsp.buf.declaration()|, |vim.lsp.buf.definition()|,
  69. |vim.lsp.buf.type_definition()|, |vim.lsp.buf.implementation()| and
  70. |vim.lsp.buf.hover()| now support merging the results of multiple clients
  71. but no longer trigger the global handlers from `vim.lsp.handlers`
  72. • |vim.lsp.buf.typehierarchy()| now passes the correct params for each
  73. client request.
  74. • |vim.lsp.handlers.signature_help()| is no longer used.
  75. • |vim.lsp.diagnostic.on_publish_diagnostics()| and
  76. |vim.lsp.diagnostic.on_diagnostic()| no longer accept a config parameter and
  77. can no longer be configured with |vim.lsp.with()|.
  78. Instead use: >lua
  79. vim.diagnostic.config(config, vim.lsp.diagnostic.get_namespace(client_id))
  80. <
  81. • |vim.lsp.util.make_position_params()|, |vim.lsp.util.make_range_params()|
  82. and |vim.lsp.util.make_given_range_params()| now require the `position_encoding`
  83. parameter.
  84. LUA
  85. • API functions now consistently return an empty dictionary as
  86. |vim.empty_dict()|. Earlier, a |lua-special-tbl| was sometimes used.
  87. • Command-line completions for: `vim.g`, `vim.t`, `vim.w`, `vim.b`, `vim.v`,
  88. `vim.o`, `vim.wo`, `vim.bo`, `vim.opt`, `vim.opt_local`, `vim.opt_global`,
  89. and `vim.fn`.
  90. OPTIONS
  91. • The 'statuscolumn' `%l` item can now be used as a number column segment that
  92. changes according to related options. It takes care of alignment, 'number',
  93. 'relativenumber' and 'signcolumn' set to "number". The now redundant `%r` item
  94. is no longer treated specially for 'statuscolumn'.
  95. • `:set {option}<` removes the local value for all |global-local| options instead
  96. of just string |global-local| options.
  97. • `:setlocal {option}<` copies the global value to the local value for number
  98. and boolean |global-local| options instead of removing the local value.
  99. • Setting |hidden-options| now gives an error. In particular, setting
  100. 'noshellslash' is now only allowed on Windows.
  101. PLUGINS
  102. • TODO
  103. TREESITTER
  104. • |Query:iter_matches()| correctly returns all matching nodes in a match
  105. instead of only the last node. This means that the returned table maps
  106. capture IDs to a list of nodes that need to be iterated over. For
  107. backwards compatibility, an option `all=false` (only return the last
  108. matching node) is provided that will be removed in a future release.
  109. • |vim.treesitter.language.get_filetypes()| always includes the {language}
  110. argument in addition to explicitly registered filetypes.
  111. • |vim.treesitter.language.get_lang()| falls back to the {filetype} argument
  112. if no languages are explicitly registered.
  113. • |vim.treesitter.language.add()| returns `true` if a parser was loaded
  114. successfully and `nil,errmsg` otherwise instead of throwing an error.
  115. • New |TSNode:child_with_descendant()|, which is nearly identical to
  116. |TSNode:child_containing_descendant()| except that it can return the
  117. descendant itself.
  118. TUI
  119. • TODO
  120. VIMSCRIPT
  121. • |v:msgpack_types| has the type "binary" removed. |msgpackparse()| no longer
  122. treats BIN, STR and FIXSTR as separate types. Any of these is returned as a
  123. string if possible, or a |blob| if the value contained embedded NUL:s.
  124. ==============================================================================
  125. NEW FEATURES *news-features*
  126. The following new features were added.
  127. API
  128. • |nvim__ns_set()| can set properties for a namespace
  129. • |vim.json.encode()| has an option to enable forward slash escaping
  130. DEFAULTS
  131. • Highlighting:
  132. • Improved styling of :checkhealth and :help buffers.
  133. • Mappings:
  134. • |grn| in Normal mode maps to |vim.lsp.buf.rename()|
  135. • |grr| in Normal mode maps to |vim.lsp.buf.references()|
  136. • |gri| in Normal mode maps to |vim.lsp.buf.implementation()|
  137. • |gO| in Normal mode maps to |vim.lsp.buf.document_symbol()|
  138. • |gra| in Normal and Visual mode maps to |vim.lsp.buf.code_action()|
  139. • CTRL-S in Insert and Select mode maps to |vim.lsp.buf.signature_help()|
  140. • Mouse |popup-menu| includes an "Open in web browser" item when you right-click
  141. on a URL.
  142. • Mouse |popup-menu| includes a "Go to definition" item when LSP is active
  143. in the buffer.
  144. • Mappings inspired by Tim Pope's vim-unimpaired:
  145. • |[q|, |]q|, |[Q|, |]Q|, |[CTRL-Q|, |]CTRL-Q| navigate through the |quickfix| list
  146. • |[l|, |]l|, |[L|, |]L|, |[CTRL-L|, |]CTRL-L| navigate through the |location-list|
  147. • |[t|, |]t|, |[T|, |]T|, |[CTRL-T|, |]CTRL-T| navigate through the |tag-matchlist|
  148. • |[a|, |]a|, |[A|, |]A| navigate through the |argument-list|
  149. • |[b|, |]b|, |[B|, |]B| navigate through the |buffer-list|
  150. • |[<Space>|, |]<Space>| add an empty line above and below the cursor
  151. • Snippet:
  152. • `<Tab>` in Insert and Select mode maps to `vim.snippet.jump({ direction = 1 })`
  153. when a snippet is active and jumpable forwards.
  154. • `<S-Tab>` in Insert and Select mode maps to `vim.snippet.jump({ direction = -1 })`
  155. when a snippet is active and jumpable backwards.
  156. EDITOR
  157. • Improved |paste| handling for redo (dot-repeat) and macros (|recording|):
  158. • Redoing a large paste is significantly faster and ignores 'autoindent'.
  159. • Replaying a macro with |@| also replays pasted text.
  160. • On Windows, filename arguments on the command-line prefixed with "~\" or
  161. "~/" are now expanded to the user's profile directory, not a relative path
  162. to a literal "~" directory.
  163. • |hl-PmenuMatch| and |hl-PmenuMatchSel| show matched text in completion popup.
  164. EVENTS
  165. • |CompleteDone| now sets the `reason` key in `v:event` which specifies the reason
  166. for completion being done.
  167. • |vim.on_key()| callbacks can consume the key by returning an empty string.
  168. LSP
  169. • Completion side effects (including snippet expansion, execution of commands
  170. and application of additional text edits) is now built-in.
  171. • |vim.lsp.util.locations_to_items()| sets `end_col` and `end_lnum` fields.
  172. • |vim.lsp.buf.format()| now supports passing a list of ranges
  173. via the `range` parameter (this requires support for the
  174. `textDocument/rangesFormatting` request).
  175. • |vim.lsp.buf.code_action()| actions show client name when there are multiple
  176. clients.
  177. • |vim.lsp.buf.signature_help()| can now cycle through different signatures
  178. using `<C-s>` and also support multiple clients.
  179. • The client now supports `'utf-8'` and `'utf-32'` position encodings.
  180. • |vim.lsp.buf.hover()| now highlights hover ranges using the
  181. |hl-LspReferenceTarget| highlight group.
  182. • Functions in |vim.lsp.Client| can now be called as methods.
  183. • Implemented LSP folding: |vim.lsp.foldexpr()|
  184. https://microsoft.github.io/language-server-protocol/specification/#textDocument_foldingRange
  185. • |vim.lsp.config()| has been added to define default configurations for
  186. servers. In addition, configurations can be specified in `lsp/<name>.lua`.
  187. • |vim.lsp.enable()| has been added to enable servers.
  188. LUA
  189. • |vim.fs.rm()| can delete files and directories.
  190. • |vim.validate()| now has a new signature which uses less tables,
  191. is more performant and easier to read.
  192. • |vim.str_byteindex()| and |vim.str_utfindex()| gained overload signatures
  193. supporting two new parameters, `encoding` and `strict_indexing`.
  194. OPTIONS
  195. • 'completeopt' flag "fuzzy" enables |fuzzy-matching| during |ins-completion|.
  196. • 'messagesopt' configures |:messages| and |hit-enter| prompt.
  197. • 'tabclose' controls which tab page to focus when closing a tab page.
  198. PERFORMANCE
  199. • Significantly reduced redraw time for long lines with treesitter
  200. highlighting.
  201. PLUGINS
  202. • EditorConfig
  203. • spelling_language property is now supported.
  204. STARTUP
  205. • Nvim will fail if the |--listen| or |$NVIM_LISTEN_ADDRESS| address is
  206. invalid, instead of silently skipping an invalid address.
  207. TERMINAL
  208. • The |terminal| now understands the OSC 52 escape sequence to write to the
  209. system clipboard (copy). Querying with OSC 52 (paste) is not supported.
  210. • |hl-StatusLineTerm| and |hl-StatusLineTermNC| define highlights for the
  211. status line in |terminal| windows.
  212. • The terminal buffer now supports reflow (wrapped lines adapt when the buffer
  213. is resized horizontally). Note: Lines that are not visible and kept in
  214. 'scrollback' are not reflown.
  215. • The |terminal| now supports OSC 8 escape sequences and will display
  216. hyperlinks in supporting host terminals.
  217. TREESITTER
  218. • |LanguageTree:node_for_range()| gets anonymous and named nodes for a range
  219. • |vim.treesitter.get_node()| now takes an option `include_anonymous`, default
  220. false, which allows it to return anonymous nodes as well as named nodes.
  221. • |treesitter-directive-trim!| can trim all whitespace (not just empty lines)
  222. from both sides of a node.
  223. TUI
  224. • The builtin UI declares info |nvim_set_client_info()| on its channel. See
  225. |startup-tui|. To see the current UI info, try this: >
  226. :lua =vim.api.nvim_get_chan_info(vim.api.nvim_list_uis()[1].chan)
  227. • |log| messages written by the builtin UI client (TUI, |--remote-ui|) are
  228. now prefixed with "ui" instead of "?".
  229. • The TUI will re-query the terminal's background color when a theme update
  230. notification is received and Nvim will update 'background' accordingly.
  231. UI
  232. • |vim.ui.open()| (by default bound to |gx|) accepts an `opt.cmd` parameter
  233. which controls the tool used to open the given path or URL. If you want to
  234. globally set this, you can override vim.ui.open using the same approach
  235. described at |vim.paste()|.
  236. - `vim.ui.open()` now supports
  237. [lemonade](https://github.com/lemonade-command/lemonade) as an option for
  238. opening urls/files. This is handy if you are in an ssh connection and use
  239. `lemonade`.
  240. • The |ins-completion-menu| now supports cascading highlight styles.
  241. |hl-PmenuSel| and |hl-PmenuMatch| both inherit from |hl-Pmenu|, and
  242. |hl-PmenuMatchSel| inherits highlights from both |hl-PmenuSel| and
  243. |hl-PmenuMatch|.
  244. • |vim.diagnostic.setqflist()| updates existing diagnostics quickfix list if one
  245. exists.
  246. • |ui-messages| content chunks now also contain the highlight group ID.
  247. ==============================================================================
  248. CHANGED FEATURES *news-changed*
  249. These existing features changed their behavior.
  250. • 'scrollbind' now works properly with buffers that contain virtual lines.
  251. Scrollbind works by aligning to a target top line of each window in a tab
  252. page. Previously this was done by calculating the difference between the old
  253. top line and the target top line, and scrolling by that amount. Now the
  254. top lines are calculated using screen line numbers which take virtual lines
  255. into account.
  256. • The implementation of grapheme clusters (or combining chars |mbyte-combining|)
  257. was upgraded to closely follow extended grapheme clusters as defined by UAX#29
  258. in the unicode standard. Noteworthily, this enables proper display of many
  259. more emoji characters than before, including those encoded with multiple
  260. emoji codepoints combined with ZWJ (zero width joiner) codepoints.
  261. • Text in the 'statusline', 'tabline', and 'winbar' now inherits highlights
  262. from the respective |hl-StatusLine|, |hl-TabLine|, and |hl-WinBar| highlight
  263. groups.
  264. • |vim.on_key()| callbacks won't be invoked recursively when a callback itself
  265. consumes input.
  266. • "q" in man pages now uses |CTRL-W_q| instead of |CTRL-W_c| to close the
  267. current window, and it no longer throws |E444| when there is only one window
  268. on the screen. Global variable `vim.g.pager` is removed.
  269. • Default 'titlestring' is now implemented with 'statusline' "%" format items.
  270. This means the default, empty value is essentially an alias to:
  271. `%t%(\ %M%)%(\ \(%{expand(\"%:~:h\")}\)%)%a\ -\ Nvim`. This is only an
  272. implementation simplification, not a behavior change.
  273. ==============================================================================
  274. REMOVED FEATURES *news-removed*
  275. These deprecated features were removed.
  276. • N/A
  277. ==============================================================================
  278. DEPRECATIONS *news-deprecations*
  279. See |deprecated-0.11|.
  280. vim:tw=78:ts=8:sw=2:et:ft=help:norl: