news-0.9.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. *news-0.9.txt* Nvim
  2. NVIM REFERENCE MANUAL
  3. Notable changes since Nvim 0.8 *news-0.9*
  4. Type |gO| to see the table of contents.
  5. ==============================================================================
  6. BREAKING CHANGES
  7. The following changes may require adaptations in user config or plugins.
  8. • Cscope support is now removed (see |cscope| and |nvim-removed|):
  9. - Commands removed:
  10. - `:cscope`
  11. - `:lcscope`
  12. - `:scscope`
  13. - `:cstag`
  14. - Options removed:
  15. - `cscopepathcomp`
  16. - `cscopeprg`
  17. - `cscopequickfix`
  18. - `cscoperelative`
  19. - `cscopetag`
  20. - `cscopetagorder`
  21. - `cscopeverbose`
  22. - Eval functions removed:
  23. - `cscope_connection()`
  24. Note: support for |ctags| remains with no plans to remove.
  25. See https://github.com/neovim/neovim/pull/20545 for more information.
  26. • `:hardcopy` is now removed (see |hardcopy| and |nvim-removed|):
  27. - Commands removed:
  28. - `:hardcopy`
  29. - Options removed:
  30. - `printdevice`
  31. - `printencoding`
  32. - `printexpr`
  33. - `printfont`
  34. - `printheader`
  35. - `printmbcharset`
  36. • 'paste' option is now deprecated and 'pastetoggle' is removed. |paste| works
  37. automatically in GUI and terminal (TUI) Nvim. Just Paste It.™
  38. • Changes to |vim.treesitter.get_node_text()|:
  39. - It now returns `string`, as opposed to `string|string[]|nil`.
  40. - The `concat` option has been removed as it was not consistently applied.
  41. - Invalid ranges now cause an error instead of returning `nil`.
  42. • `help` treesitter parser was renamed to `vimdoc`. The only user-visible
  43. change is that language-specific highlight groups need to be renamed from
  44. `@foo.help` to `@foo.vimdoc`.
  45. • The default value of 'commentstring' is now empty instead of "/*%s*/".
  46. • libiconv and intl are now required build dependencies.
  47. ==============================================================================
  48. NEW FEATURES
  49. The following new APIs or features were added.
  50. • Treesitter syntax highlighting for `help` files now supports highlighted
  51. code examples. To enable, create a `.config/nvim/ftplugin/help.lua` with
  52. the contents >lua
  53. vim.treesitter.start()
  54. <
  55. Note: Highlighted code examples are only available in the Nvim manual, not
  56. in help files taken from Vim. The treesitter `vimdoc` parser is also work in
  57. progress and not guaranteed to correctly highlight every help file in the
  58. wild.
  59. • Added support for semantic token highlighting to the LSP client. This
  60. functionality is enabled by default when a client that supports this feature
  61. is attached to a buffer. Opt-out can be performed by deleting the
  62. `semanticTokensProvider` from the LSP client's {server_capabilities} in the
  63. `LspAttach` callback.
  64. See |lsp-semantic-highlight| for more information.
  65. • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
  66. at a given buffer position. Currently this includes treesitter captures,
  67. LSP semantic tokens, syntax groups and extmarks.
  68. • |vim.treesitter.inspect_tree()| and |:InspectTree| opens a split window
  69. showing a text representation of the nodes in a language tree for the current
  70. buffer.
  71. • 'statuscolumn' option to customize the area to the side of a window,
  72. normally containing the fold, sign and number columns. This new option follows
  73. the 'statusline' syntax and can be used to transform the line numbers, create
  74. mouse click callbacks for |signs|, introduce a custom margin or separator etc.
  75. • |vim.secure.trust()|, |:trust| allows the user to manage files in trust database.
  76. |vim.secure.read()| reads a file and prompts the user if it should be
  77. trusted and, if so, returns the file's contents. Used by 'exrc'
  78. • EditorConfig support is now builtin. This is enabled by default and happens
  79. automatically. To disable it, users should add >lua
  80. vim.g.editorconfig = false
  81. <
  82. (or the Vimscript equivalent) to their |config| file.
  83. • A new environment variable named NVIM_APPNAME enables configuring the
  84. directories where Nvim should find its configuration and state files. See
  85. `:help $NVIM_APPNAME` .
  86. • Added support for running Lua scripts from shell using |-l|. >
  87. nvim -l foo.lua --arg1 --arg2
  88. < Also works with stdin: >
  89. echo "print(42)" | nvim -l -
  90. • Added an omnifunc implementation for Lua, |vim.lua_omnifunc()|
  91. • Added a new experimental |vim.loader| that byte-compiles and caches Lua files.
  92. To enable the new loader, add the following at the top of your |init.lua|: >lua
  93. vim.loader.enable()
  94. • Added |vim.version| for parsing and comparing version strings conforming to
  95. the semver specification.
  96. • When using Nvim inside tmux 3.2 or later, the default clipboard provider
  97. will now copy to the system clipboard. |provider-clipboard|
  98. • 'showcmdloc' option to display the 'showcmd' information in the status
  99. line or tab line. A new %S statusline item is available to place the
  100. 'showcmd' text in a custom 'statusline'. Useful for when 'cmdheight' is set
  101. to 0.
  102. • 'splitkeep' option to control the scroll behavior of horizontal splits.
  103. • 'wildoptions' flag "fuzzy" enables |fuzzy-matching| during |cmdline-completion|.
  104. • 'diffopt' now includes a `linematch` option to enable a second-stage diff on
  105. individual hunks to provide much more accurate diffs. This option is also
  106. available to |vim.diff()|
  107. See https://github.com/neovim/neovim/pull/14537.
  108. • |--remote-ui| option was added to connect to a remote instance and display
  109. in it in a |TUI| in the local terminal. This can be used run a headless nvim
  110. instance in the background and display its UI on demand, which previously
  111. only was possible using an external UI implementation.
  112. • Added a |vim.lsp.codelens.clear()| function to clear codelenses.
  113. • Added support for the `willSave` and `willSaveWaitUntil` capabilities to the
  114. LSP client. `willSaveWaitUntil` allows a server to modify a document before it
  115. gets saved. Example use-cases by language servers include removing unused
  116. imports, or formatting the file.
  117. • Added preliminary support for the `workspace/didChangeWatchedFiles` capability
  118. to the LSP client to notify servers of file changes on disk. The feature is
  119. disabled by default and can be enabled by setting the
  120. `workspace.didChangeWatchedFiles.dynamicRegistration=true` capability.
  121. • |vim.diagnostic| now supports LSP DiagnosticsTag.
  122. See: https://microsoft.github.io/language-server-protocol/specification/#diagnosticTag
  123. • vim.diagnostic.is_disabled() checks if diagnostics are disabled in a given
  124. buffer or namespace.
  125. • Treesitter captures can now be transformed by directives. This will allow
  126. more complicated dynamic language injections.
  127. • |vim.treesitter.get_node_text()| now accepts a `metadata` option for
  128. writing custom directives using |vim.treesitter.query.add_directive()|.
  129. • |vim.treesitter.language.add()| replaces `vim.treesitter.language.require_language`.
  130. • |vim.treesitter.foldexpr()| can be used for 'foldexpr' to use treesitter for folding.
  131. • Expanded the TSNode API with:
  132. - |TSNode:tree()|
  133. - |TSNode:has_changes()|
  134. - |TSNode:extra()|
  135. - |TSNode:equal()|
  136. Additionally |TSNode:range()| now takes an optional {include_bytes} argument.
  137. • Treesitter injection queries now use the format described at
  138. https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection .
  139. Support for the previous format will be removed in a future release.
  140. • Added |nvim_get_hl()| for getting highlight group definitions in a format
  141. compatible with |nvim_set_hl()|.
  142. • |vim.filetype.get_option()| to get the default option value for a specific
  143. filetype. This is a wrapper around |nvim_get_option_value()| with caching.
  144. • `require'bit'` is now always available |lua-bit|
  145. ==============================================================================
  146. CHANGED FEATURES
  147. The following changes to existing APIs or features add new behavior.
  148. • 'exrc' now supports `.nvim.lua` file.
  149. • 'exrc' is no longer marked deprecated.
  150. • The |TUI| is changed to run in a separate process (previously, a separate
  151. thread was used). This is not supposed to be a visible change to the user,
  152. but might be the cause of subtle changes of behavior and bugs.
  153. Previously, the TUI could be disabled as a build time feature (+tui/-tui),
  154. resulting in a nvim binary which only could be run headless or embedded
  155. in an external process. As of this version, TUI is always available.
  156. • Vim's `has('gui_running')` is now supported as a way for plugins to check if
  157. a GUI (not the |TUI|) is attached to Nvim. |has()|
  158. • |msgsep| is now always enabled even if 'display' doesn't contain the "msgsep"
  159. flag. It is no longer possible to scroll the whole screen when showing
  160. messages longer than 'cmdheight'.
  161. • API calls now show more information about where an exception happened.
  162. • The `win_viewport` UI event now contains information about virtual lines,
  163. meaning that smooth scrolling can now be implemented more consistently.
  164. • The `:= {expr}` syntax can be used to evaluate a Lua expression, as
  165. a shorter form of `:lua ={expr}`. `:=` and `:[range]=` without argument
  166. are unchanged. However `:=#` and similar variants using |ex-flags|
  167. are no longer supported.
  168. • Unsaved changes are now preserved rather than discarded when |channel-stdio|
  169. is closed.
  170. • |nvim_open_win()| now accepts a relative `mouse` option to open a floating win
  171. relative to the mouse. Note that the mouse doesn't update frequently without
  172. setting `vim.o.mousemoveevent = true`
  173. • |nvim_eval_statusline()| supports evaluating the 'statuscolumn' through a
  174. new `opts` field: `use_statuscol_lnum`.
  175. • |nvim_buf_get_extmarks()| now accepts a -1 `ns_id` to request extmarks from
  176. all namespaces and adds the namespace id to the details array.
  177. Other missing properties have been added to the details array and marks can
  178. be filtered by type.
  179. • |vim.diagnostic.open_float()| (and therefore |vim.diagnostic.config()|) now
  180. accepts a `suffix` option which, by default, renders LSP error codes.
  181. Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now
  182. has a `suffix` option which does nothing by default.
  183. • |vim.fs.dir()| now has a `opts` argument with a depth field to allow
  184. recursively searching a directory tree.
  185. • |vim.gsplit()| supports all features of |vim.split()|.
  186. • |:highlight| now supports an additional attribute "altfont".
  187. • |:Man| manpage viewer supports manpage names containing spaces.
  188. • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
  189. • |nvim_list_uis()| reports all |ui-option| fields.
  190. • |nvim_get_option_value()| now has a `filetype` option so it can return the
  191. default option for a specific filetype.
  192. • build: Several improvements were made to make the code generation scripts more
  193. deterministic, and a `LUA_GEN_PRG` build parameter has been introduced to
  194. allow for a workaround for some remaining reproducibility problems.
  195. ==============================================================================
  196. REMOVED FEATURES
  197. The following deprecated functions or APIs were removed.
  198. • `filetype.vim` is removed in favor of |vim.filetype|
  199. (Note that filetype logic and tests still align with Vim, so additions or
  200. changes need to be contributed there first.)
  201. See https://github.com/neovim/neovim/pull/20674.
  202. • 'hkmap', 'hkmapp' and 'aleph' options were removed. Use 'keymap' option instead.
  203. • |LanguageTree:parse()| no longer returns changed regions. Please use the
  204. `on_changedtree` callbacks instead.
  205. • `vim.highlight.create()`, `vim.highlight.link()` were removed, use |nvim_set_hl()| instead.
  206. • `require'health'` was removed. Use |vim.health| instead.
  207. ==============================================================================
  208. DEPRECATIONS
  209. See |deprecated-0.9|.
  210. vim:tw=78:ts=8:sw=2:et:ft=help:norl: