neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

news-0.9.txt (12019B)


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