diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/api.txt | 16 | ||||
-rw-r--r-- | runtime/doc/deprecated.txt | 2 | ||||
-rw-r--r-- | runtime/doc/diagnostic.txt | 8 | ||||
-rw-r--r-- | runtime/doc/editorconfig.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lua-guide.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 9 | ||||
-rw-r--r-- | runtime/doc/map.txt | 26 | ||||
-rw-r--r-- | runtime/doc/news-0.9.txt | 323 | ||||
-rw-r--r-- | runtime/doc/news.txt | 294 | ||||
-rw-r--r-- | runtime/doc/options.txt | 4 | ||||
-rw-r--r-- | runtime/doc/pi_health.txt | 2 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 4 | ||||
-rw-r--r-- | runtime/doc/support.txt | 2 | ||||
-rw-r--r-- | runtime/doc/treesitter.txt | 8 | ||||
-rw-r--r-- | runtime/doc/various.txt | 3 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 6 |
17 files changed, 387 insertions, 326 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 1adf0a305f..d63563cc05 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -773,6 +773,8 @@ nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()* • use_tabline: (boolean) Evaluate tabline instead of statusline. When true, {winid} is ignored. Mutually exclusive with {use_winbar}. + • use_statuscol_lnum: (number) Evaluate statuscolumn for this + line number instead of statusline. Return: ~ Dictionary containing statusline information, with these keys: @@ -2568,17 +2570,17 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts}) `limit`, to get the first marks prior to a given position.) Example: >lua - local a = vim.api - local pos = a.nvim_win_get_cursor(0) - local ns = a.nvim_create_namespace('my-plugin') + local api = vim.api + local pos = api.nvim_win_get_cursor(0) + local ns = api.nvim_create_namespace('my-plugin') -- Create new extmark at line 1, column 1. - local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, {}) + local m1 = api.nvim_buf_set_extmark(0, ns, 0, 0, {}) -- Create new extmark at line 3, column 1. - local m2 = a.nvim_buf_set_extmark(0, ns, 2, 0, {}) + local m2 = api.nvim_buf_set_extmark(0, ns, 2, 0, {}) -- Get extmarks only from line 3. - local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) + local ms = api.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) -- Get all marks in this buffer + namespace. - local all = a.nvim_buf_get_extmarks(0, ns, 0, -1, {}) + local all = api.nvim_buf_get_extmarks(0, ns, 0, -1, {}) print(vim.inspect(ms)) < diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 3eb2017bed..3735073867 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -130,6 +130,8 @@ TREESITTER FUNCTIONS instead. - *vim.treesitter.get_node_at_cursor()* Use |vim.treesitter.get_node()| and |TSNode:type()| instead. +- *vim.treesitter.query.get_query()* Use |vim.treesitter.query.get()| + instead. LUA - vim.register_keystroke_callback() Use |vim.on_key()| instead. diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index f888bb0991..025a7dccfc 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -295,6 +295,14 @@ DiagnosticSignHint DiagnosticSignOk Used for "Ok" signs in sign column. + *hl-DiagnosticDeprecated* +DiagnosticDeprecated + Used for deprecated or obsolete code. + + *hl-DiagnosticUnnecessary* +DiagnosticUnnecessary + Used for unnecessary or unused code. + ============================================================================== SIGNS *diagnostic-signs* diff --git a/runtime/doc/editorconfig.txt b/runtime/doc/editorconfig.txt index 52fd860d2d..7c6e8fb95f 100644 --- a/runtime/doc/editorconfig.txt +++ b/runtime/doc/editorconfig.txt @@ -48,7 +48,7 @@ indent_style One of "tab" or "space". Sets the 'expandtab' option. indent_size A number indicating the size of a single indent. Alternatively, use the value "tab" to use the value of the tab_width property. Sets the 'shiftwidth' and - 'softtabstop'. + 'softtabstop' options. *editorconfig_insert_final_newline* insert_final_newline "true" or "false" to ensure the file always has a diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index f5695669ae..01edbe7cbd 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -517,7 +517,7 @@ groups are derived from the token's type and modifiers: • `@lsp.type.<type>.<ft>` for the type • `@lsp.mod.<mod>.<ft>` for each modifier • `@lsp.typemod.<type>.<mod>.<ft>` for each modifier -Use |:Inspect| to view the higlights for a specific token. Use |:hi| or +Use |:Inspect| to view the highlights for a specific token. Use |:hi| or |nvim_set_hl()| to change the appearance of semantic highlights: >vim hi @lsp.type.function guifg=Yellow " function names are yellow diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt index 5e2b753645..3c2e1ac3d1 100644 --- a/runtime/doc/lua-guide.txt +++ b/runtime/doc/lua-guide.txt @@ -539,7 +539,7 @@ about the triggered autocommand. The most useful keys are For example, this allows you to set buffer-local mappings for some filetypes: >lua - vim.api.nvim.create_autocmd("FileType", { + vim.api.nvim_create_autocmd("FileType", { pattern = "lua", callback = function(args) vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf }) diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index ebbf8bb463..6084a625ba 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -685,9 +685,10 @@ vim.diff({a}, {b}, {opts}) *vim.diff()* • "unified": (default) String in unified format. • "indices": Array of hunk locations. Note: This option is ignored if `on_hunk` is used. - • `linematch` (boolean): Run linematch on the resulting hunks - from xdiff. Requires `result_type = indices`, ignored - otherwise. + • `linematch` (boolean|integer): Run linematch on the resulting hunks + from xdiff. When integer, only hunks upto this size in + lines are run through linematch. Requires `result_type = indices`, + ignored otherwise. • `algorithm` (string): Diff algorithm to use. Values: • "myers" the default algorithm @@ -2001,7 +2002,7 @@ validate({opt}) *vim.validate()* vim.validate{arg1={{'foo'}, {'table', 'string'}}, arg2={'foo', {'table', 'string'}}} --> NOP (success) - vim.validate{arg1={1, {'string', table'}}} + vim.validate{arg1={1, {'string', 'table'}}} --> error('arg1: expected string|table, got number') < diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index c65007d1a4..cd374c6f34 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -540,28 +540,10 @@ See |:verbose-cmd| for more information. 1.5 MAPPING SPECIAL KEYS *:map-special-keys* -There are two ways to map a special key: -1. The Vi-compatible method: Map the key code. Often this is a sequence that - starts with <Esc>. To enter a mapping like this you type ":map " and then - you have to type CTRL-V before hitting the function key. Note that when - the key code for the key is in the |terminfo| entry, it will automatically - be translated into the internal code and become the second way of mapping. -2. The second method is to use the internal code for the function key. To - enter such a mapping type CTRL-K and then hit the function key, or use - the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc. - (see table of keys |key-notation|, all keys from <Up> can be used). The - first ten function keys can be defined in two ways: Just the number, like - "#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0" - refers to function key 10. - -DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it -isn't the terminal key codes are tried. If a terminal code is found it is -replaced with the internal code. Then the check for a mapping is done again -(so you can map an internal code to something else). What is written into the -script file depends on what is recognized. If the terminal key code was -recognized as a mapping the key code itself is written to the script file. If -it was recognized as a terminal code the internal code is written to the -script file. +To map a function key, use the internal code for it. To enter such a mapping +type CTRL-K and then hit the function key, or use the form "<F2>", "<F10>", +"<Up>", "<S-Down>", "<S-F7>", etc. (see table of keys |key-notation|, all keys +from <Up> can be used). 1.6 SPECIAL CHARACTERS *:map-special-chars* diff --git a/runtime/doc/news-0.9.txt b/runtime/doc/news-0.9.txt new file mode 100644 index 0000000000..c7624119e2 --- /dev/null +++ b/runtime/doc/news-0.9.txt @@ -0,0 +1,323 @@ +*news-0.9.txt* Nvim + + + NVIM REFERENCE MANUAL + + +Notable changes in Nvim 0.9 from 0.8 *news-0.9* + + Type |gO| to see the table of contents. + +============================================================================== +BREAKING CHANGES + +The following changes may require adaptations in user config or plugins. + +• Cscope support is now removed (see |cscope| and |nvim-removed|): + - Commands removed: + - `:cscope` + - `:lcscope` + - `:scscope` + - `:cstag` + - Options removed: + - `cscopepathcomp` + - `cscopeprg` + - `cscopequickfix` + - `cscoperelative` + - `cscopetag` + - `cscopetagorder` + - `cscopeverbose` + - Eval functions removed: + - `cscope_connection()` + + Note: support for |ctags| remains with no plans to remove. + + See https://github.com/neovim/neovim/pull/20545 for more information. + +• `:hardcopy` is now removed (see |hardcopy| and |nvim-removed|): + - Commands removed: + - `:hardcopy` + - Options removed: + - `printdevice` + - `printencoding` + - `printexpr` + - `printfont` + - `printheader` + - `printmbcharset` + +• 'paste' option is now deprecated and 'pastetoggle' is removed. |paste| works + automatically in GUI and terminal (TUI) Nvim. Just Paste It.™ + +• Changes to |vim.treesitter.get_node_text()|: + - It now returns `string`, as opposed to `string|string[]|nil`. + - The `concat` option has been removed as it was not consistently applied. + - Invalid ranges now cause an error instead of returning `nil`. + +• `help` treesitter parser was renamed to `vimdoc`. The only user-visible + change is that language-specific highlight groups need to be renamed from + `@foo.help` to `@foo.vimdoc`. + +• The default value of 'commentstring' is now empty instead of "/*%s*/". + +• libiconv and intl are now required build dependencies. + +============================================================================== +NEW FEATURES + +The following new APIs or features were added. + +• Treesitter syntax highlighting for `help` files now supports highlighted + code examples. To enable, create a `.config/nvim/ftplugin/help.lua` with + the contents >lua + vim.treesitter.start() +< + Note: Highlighted code examples are only available in the Nvim manual, not + in help files taken from Vim. The treesitter `vimdoc` parser is also work in + progress and not guaranteed to correctly highlight every help file in the + wild. + +• Added support for semantic token highlighting to the LSP client. This + functionality is enabled by default when a client that supports this feature + is attached to a buffer. Opt-out can be performed by deleting the + `semanticTokensProvider` from the LSP client's {server_capabilities} in the + `LspAttach` callback. + + See |lsp-semantic-highlight| for more information. + +• |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items + at a given buffer position. Currently this includes treesitter captures, + LSP semantic tokens, syntax groups and extmarks. + +• |vim.treesitter.inspect_tree()| and |:InspectTree| opens a split window + showing a text representation of the nodes in a language tree for the current + buffer. + +• |'statuscolumn'| option to customize the area to the side of a window, + normally containing the fold, sign and number columns. This new option follows + the 'statusline' syntax and can be used to transform the line numbers, create + mouse click callbacks for |signs|, introduce a custom margin or separator etc. + +• |vim.secure.trust()|, |:trust| allows the user to manage files in trust database. + |vim.secure.read()| reads a file and prompts the user if it should be + trusted and, if so, returns the file's contents. Used by 'exrc' + +• EditorConfig support is now builtin. This is enabled by default and happens + automatically. To disable it, users should add >lua + + vim.g.editorconfig = false +< + (or the Vimscript equivalent) to their |config| file. + +• A new environment variable named NVIM_APPNAME enables configuring the + directories where Neovim should find its configuration and state files. See + `:help $NVIM_APPNAME` . + +• Added support for running Lua scripts from shell using |-l|. > + nvim -l foo.lua --arg1 --arg2 +< Also works with stdin: > + echo "print(42)" | nvim -l - + +• Added an omnifunc implementation for lua, |vim.lua_omnifunc()| + +• Added a new experimental |lua-loader| that byte-compiles and caches lua files. + To enable the new loader, add the following at the top of your |init.lua|: >lua + vim.loader.enable() + +• Added |lua-version| for parsing and comparing version strings conforming to + the semver specification. + +• When using Nvim inside tmux 3.2 or later, the default clipboard provider + will now copy to the system clipboard. |provider-clipboard| + +• |'showcmdloc'| option to display the 'showcmd' information in the + status line or tab line. A new %S statusline item is available to place + the 'showcmd' text in a custom 'statusline'. Useful for when |'cmdheight'| + is set to 0. + +• |'splitkeep'| option to control the scroll behavior of horizontal splits. + +• |'diffopt'| now includes a `linematch` option to enable a second-stage diff + on individual hunks to provide much more accurate diffs. This option is also + available to |vim.diff()| + + See https://github.com/neovim/neovim/pull/14537. + +• |--remote-ui| option was added to connect to a remote instance and display + in it in a |TUI| in the local terminal. This can be used run a headless nvim + instance in the background and display its UI on demand, which previously + only was possible using an external UI implementation. + +• Added a |vim.lsp.codelens.clear()| function to clear codelenses. + +• Added support for the `willSave` and `willSaveWaitUntil` capabilities to the + LSP client. `willSaveWaitUntil` allows a server to modify a document before it + gets saved. Example use-cases by language servers include removing unused + imports, or formatting the file. + +• Added preliminary support for the `workspace/didChangeWatchedFiles` capability + to the LSP client to notify servers of file changes on disk. The feature is + disabled by default and can be enabled by setting the + `workspace.didChangeWatchedFiles.dynamicRegistration=true` capability. + +• |vim.diagnostic| now supports LSP DiagnosticsTag. + See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticTag + +• |vim.diagnostic.is_disabled()| checks if diagnostics are disabled in a given + buffer or namespace. + +• Treesitter captures can now be transformed by directives. This will allow + more complicated dynamic language injections. + +• |vim.treesitter.get_node_text()| now accepts a `metadata` option for + writing custom directives using |vim.treesitter.query.add_directive()|. + +• |vim.treesitter.language.add()| replaces `vim.treesitter.language.require_language`. + +• |vim.treesitter.foldexpr()| can be used for 'foldexpr' to use treesitter for folding. + +• Expanded the TSNode API with: + - |TSNode:tree()| + - |TSNode:has_changes()| + - |TSNode:extra()| + - |TSNode:equal()| + + Additionally |TSNode:range()| now takes an optional {include_bytes} argument. + +• Treesitter injection queries now use the format described at + https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection . + Support for the previous format will be removed in a future release. + +• Added |nvim_get_hl()| for getting highlight group definitions in a format + compatible with |nvim_set_hl()|. + +• |vim.filetype.get_option()| to get the default option value for a specific + filetype. This is a wrapper around |nvim_get_option_value()| with caching. + +• `require'bit'` is now always available |lua-bit| + +============================================================================== +CHANGED FEATURES + +The following changes to existing APIs or features add new behavior. + +• 'exrc' now supports `.nvim.lua` file. +• 'exrc' is no longer marked deprecated. + +• The |TUI| is changed to run in a separate process (previously, a separate + thread was used). This is not supposed to be a visible change to the user, + but might be the cause of subtle changes of behavior and bugs. + + Previously, the TUI could be disabled as a build time feature (+tui/-tui), + resulting in a nvim binary which only could be run headless or embedded + in an external process. As of this version, TUI is always available. + +• Vim's `has('gui_running')` is now supported as a way for plugins to check if + a GUI (not the |TUI|) is attached to Nvim. |has()| + +• |msgsep| is now always enabled even if 'display' doesn't contain the "msgsep" + flag. It is no longer possible to scroll the whole screen when showing + messages longer than 'cmdheight'. + +• API calls now show more information about where an exception happened. + +• The `win_viewport` UI event now contains information about virtual lines, + meaning that smooth scrolling can now be implemented more consistently. + +• The `:= {expr}` syntax can be used to evaluate a lua expression, as + a shorter form of `:lua ={expr}`. `:=` and `:[range]=` without argument + are unchanged. However `:=#` and similar variants using |ex-flags| + are no longer supported. + +• Unsaved changes are now preserved rather than discarded when |channel-stdio| + is closed. + +• |nvim_open_win()| now accepts a relative `mouse` option to open a floating win + relative to the mouse. Note that the mouse doesn't update frequently without + setting `vim.o.mousemoveevent = true` + +• |nvim_eval_statusline()| supports evaluating the |'statuscolumn'| through a + new `opts` field: `use_statuscol_lnum`. + +• |nvim_buf_get_extmarks()| now accepts a -1 `ns_id` to request extmarks from + all namespaces and adds the namespace id to the details array. + Other missing properties have been added to the details array and marks can + be filtered by type. + +• |vim.diagnostic.open_float()| (and therefore |vim.diagnostic.config()|) now + accepts a `suffix` option which, by default, renders LSP error codes. + Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now + has a `suffix` option which does nothing by default. + +• |vim.fs.dir()| now has a `opts` argument with a depth field to allow + recursively searching a directory tree. + +• |vim.gsplit()| supports all features of |vim.split()|. + +• |:highlight| now supports an additional attribute "altfont". + +• |:Man| manpage viewer supports manpage names containing spaces. + +• |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu. + +• |nvim_list_uis()| reports all |ui-option| fields. + +• |nvim_get_option_value()| now has a `filetype` option so it can return the + default option for a specific filetype. + +• build: Several improvements were made to make the code generation scripts more + deterministic, and a `LUA_GEN_PRG` build parameter has been introduced to + allow for a workaround for some remaining reproducibility problems. + +============================================================================== +REMOVED FEATURES + +The following deprecated functions or APIs were removed. + +• `filetype.vim` is removed in favor of |lua-filetype| + (Note that filetype logic and tests still align with Vim, so additions or + changes need to be contributed there first.) + See https://github.com/neovim/neovim/pull/20674. + +• 'hkmap', 'hkmapp' and 'aleph' options were removed. Use 'keymap' option instead. + +• |LanguageTree:parse()| no longer returns changed regions. Please use the + `on_changedtree` callbacks instead. + +• `vim.highlight.create()`, `vim.highlight.link()` were removed, use |nvim_set_hl()| instead. + +• `require'health'` was removed. Use |vim.health| instead. + +============================================================================== +DEPRECATIONS + +The following functions are now deprecated and will be removed in the next +release. + +• |vim.treesitter.language.add()| replaces `vim.treesitter.language.require_language()` + +• |vim.treesitter.get_node_at_pos()| and |vim.treesitter.get_node_at_cursor()| + are both deprecated in favor of |vim.treesitter.get_node()|. + +• `vim.api.nvim_get_hl_by_name()`, `vim.api.nvim_get_hl_by_id()` were deprecated, use |nvim_get_hl()| instead. + +• The following top level Treesitter functions have been moved: + `vim.treesitter.inspect_language()` -> `vim.treesitter.language.inspect()` + `vim.treesitter.get_query_files()` -> `vim.treesitter.query.get_files()` + `vim.treesitter.set_query()` -> `vim.treesitter.query.set()` + `vim.treesitter.query.set_query()` -> `vim.treesitter.query.set()` + `vim.treesitter.get_query()` -> `vim.treesitter.query.get()` + `vim.treesitter.query.get_query()` -> `vim.treesitter.query.get()` + `vim.treesitter.parse_query()` -> `vim.treesitter.query.parse()` + `vim.treesitter.query.parse_query()` -> `vim.treesitter.query.parse()` + `vim.treesitter.add_predicate()` -> `vim.treesitter.query.add_predicate()` + `vim.treesitter.add_directive()` -> `vim.treesitter.query.add_directive()` + `vim.treesitter.list_predicates()` -> `vim.treesitter.query.list_predicates()` + `vim.treesitter.list_directives()` -> `vim.treesitter.query.list_directives()` + `vim.treesitter.query.get_range()` -> `vim.treesitter.get_range()` + `vim.treesitter.query.get_node_text()` -> `vim.treesitter.get_node_text()` + +• |nvim_exec()| is now deprecated in favor of |nvim_exec2()|. + +• Renamed |vim.pretty_print()| to |vim.print()|. + + vim:tw=78:ts=8:sw=2:et:ft=help:norl: diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 3ef6451ef9..6e2a1b1d3f 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -1,10 +1,12 @@ *news.txt* Nvim - NVIM REFERENCE MANUAL + NVIM REFERENCE MANUAL -Notable changes in Nvim 0.9 from 0.8 *news* +Notable changes in Nvim 0.10 from 0.9 *news* + +For changes in Nvim 0.9, see |news-0.9|. Type |gO| to see the table of contents. @@ -13,281 +15,29 @@ BREAKING CHANGES *news-breaking* The following changes may require adaptations in user config or plugins. -• Cscope support is now removed (see |cscope| and |nvim-removed|): - - Commands removed: - - `:cscope` - - `:lcscope` - - `:scscope` - - `:cstag` - - Options removed: - - `cscopepathcomp` - - `cscopeprg` - - `cscopequickfix` - - `cscoperelative` - - `cscopetag` - - `cscopetagorder` - - `cscopeverbose` - - Eval functions removed: - - `cscope_connection()` - - Note: support for |ctags| remains with no plans to remove. - - See https://github.com/neovim/neovim/pull/20545 for more information. - -• `:hardcopy` is now removed (see |hardcopy| and |nvim-removed|): - - Commands removed: - - `:hardcopy` - - Options removed: - - `printdevice` - - `printencoding` - - `printexpr` - - `printfont` - - `printheader` - - `printmbcharset` - -• 'paste' option is now deprecated and 'pastetoggle' is removed. |paste| works - automatically in GUI and terminal (TUI) Nvim. Just Paste It.™ - -• libiconv and intl are now required build dependencies. - -• Unsaved changes are now preserved rather than discarded when |channel-stdio| - is closed. - -• Changes to |vim.treesitter.get_node_text()|: - - It now returns `string`, as opposed to `string|string[]|nil`. - - The `concat` option has been removed as it was not consistently applied. - - Invalid ranges now cause an error instead of returning `nil`. - -• Renamed vim.pretty_print to vim.print. |deprecated| - -• |nvim_exec()| is now deprecated in favor of |nvim_exec2()|. - -• `help` treesitter parser was renamed to `vimdoc`. The only user-visible - change is that language-specific highlight groups need to be renamed from - `@foo.help` to `@foo.vimdoc`. - -• The default value of 'commentstring' is now empty instead of "/*%s*/". +• "#" followed by a digit no longer stands for a function key at the start of + the lhs of a mapping. ============================================================================== -NEW FEATURES *news-features* +ADDED FEATURES *news-added* The following new APIs or features were added. -• |nvim_buf_get_extmarks()| now accepts a -1 `ns_id` to request extmarks from - all namespaces and adds the namespace id to the details array. - Other missing properties have been added to the details array and marks can - be filtered by type. - -• Added a new experimental |lua-loader| that byte-compiles and caches lua files. - To enable the new loader, add the following at the top of your |init.lua|: >lua - vim.loader.enable() - -• Added |lua-version| for parsing and comparing version strings conforming to - the semver specification. - -• A new environment variable named NVIM_APPNAME enables configuring the - directories where Neovim should find its configuration and state files. See - `:help $NVIM_APPNAME` . - -• |nvim_open_win()| now accepts a relative `mouse` option to open a floating win - relative to the mouse. Note that the mouse doesn't update frequently without - setting `vim.o.mousemoveevent = true` - -• EditorConfig support is now builtin. This is enabled by default and happens - automatically. To disable it, users should add >lua - - vim.g.editorconfig = false -< - (or the Vimscript equivalent) to their |config| file. - -• Added support for running Lua scripts from shell using |-l|. > - nvim -l foo.lua --arg1 --arg2 -< Also works with stdin: > - echo "print(42)" | nvim -l - - -• Added a |vim.lsp.codelens.clear()| function to clear codelenses. - -• |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items - at a given buffer position. Currently this includes treesitter captures, - semantic tokens, syntax groups and extmarks. - -• Added support for semantic token highlighting to the LSP client. This - functionality is enabled by default when a client that supports this feature - is attached to a buffer. Opt-out can be performed by deleting the - `semanticTokensProvider` from the LSP client's {server_capabilities} in the - `LspAttach` callback. - - See |lsp-semantic-highlight| for more information. - -• |vim.treesitter.inspect_tree()| and |:InspectTree| opens a split window - showing a text representation of the nodes in a language tree for the current - buffer. - -• Added support for the `willSave` and `willSaveWaitUntil` capabilities to the - LSP client. `willSaveWaitUntil` allows a server to modify a document before it - gets saved. Example use-cases by language servers include removing unused - imports, or formatting the file. - -• Treesitter syntax highlighting for `help` files now supports highlighted - code examples. To enable, create a `.config/nvim/ftplugin/help.lua` with - the contents >lua - vim.treesitter.start() -< - Note: Highlighted code examples are only available in the Nvim manual, not - in help files taken from Vim. The treesitter `help` parser is also work in - progress and not guaranteed to correctly highlight every help file in the - wild. - -• |vim.secure.trust()|, |:trust| allows the user to manage files in trust - database. - -• |vim.diagnostic.open_float()| (and therefore |vim.diagnostic.config()|) now - accepts a `suffix` option which, by default, renders LSP error codes. - Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now - has a `suffix` option which does nothing by default. - -• |vim.fs.dir()| now has a `opts` argument with a depth field to allow - recursively searching a directory tree. - -• |vim.gsplit()| supports all features of |vim.split()|. - -• |vim.secure.read()| reads a file and prompts the user if it should be - trusted and, if so, returns the file's contents. - -• When using Nvim inside tmux 3.2 or later, the default clipboard provider - will now copy to the system clipboard. |provider-clipboard| - -• |'showcmdloc'| option to display the 'showcmd' information in the - status line or tab line. A new %S statusline item is available to place - the 'showcmd' text in a custom 'statusline'. Useful for when |'cmdheight'| - is set to 0. - -• |'splitkeep'| option to control the scroll behavior of horizontal splits. - -• |'statuscolumn'| option to customize the area to the side of a window, - normally containing the fold, sign and number columns. This new option follows - the 'statusline' syntax and can be used to transform the line numbers, create - mouse click callbacks for |signs|, introduce a custom margin or separator etc. - -• |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu. - -• |'diffopt'| now includes a `linematch` option to enable a second-stage diff - on individual hunks to provide much more accurate diffs. This option is also - available to |vim.diff()| - - See https://github.com/neovim/neovim/pull/14537. - -• |vim.diagnostic.is_disabled()| checks if diagnostics are disabled in a given - buffer or namespace. - -• |--remote-ui| option was added to connect to a remote instance and display - in it in a |TUI| in the local terminal. This can be used run a headless nvim - instance in the background and display its UI on demand, which previously - only was possible using an external UI implementation. - -• Several improvements were made to make the code generation scripts more - deterministic, and a `LUA_GEN_PRG` build parameter has been introduced to - allow for a workaround for some remaining reproducibility problems. - -• |:highlight| now supports an additional attribute "altfont". - -• |:Man| manpage viewer supports manpage names containing spaces. - -• Treesitter captures can now be transformed by directives. This will allow - more complicated dynamic language injections. - -• |vim.treesitter.get_node_text()| now accepts a `metadata` option for - writing custom directives using |vim.treesitter.query.add_directive()|. - -• |vim.treesitter.language.add()| replaces `vim.treesitter.language.require_language`. - -• `require'bit'` is now always available |lua-bit| - -• |vim.treesitter.foldexpr()| can be used for 'foldexpr' to use treesitter for folding. - -• Expanded the TSNode API with: - - |TSNode:tree()| - - |TSNode:has_changes()| - - |TSNode:extra()| - - |TSNode:equal()| - - Additionally |TSNode:range()| now takes an optional {include_bytes} argument. - -• |nvim_list_uis()| reports all |ui-option| fields. - -• Vim's `has('gui_running')` is now supported as a way for plugins to check if - a GUI (not the |TUI|) is attached to Nvim. |has()| - -• Added preliminary support for the `workspace/didChangeWatchedFiles` capability - to the LSP client to notify servers of file changes on disk. The feature is - disabled by default and can be enabled by setting the - `workspace.didChangeWatchedFiles.dynamicRegistration=true` capability. - -• Added an omnifunc implementation for lua, |vim.lua_omnifunc()| - -• Treesitter injection queries now use the format described at - https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection . - Support for the previous format will be removed in a future release. - -• |nvim_get_option_value()| now has a `filetype` option so it can return the - default option for a specific filetype. - -• |vim.filetype.get_option()| to get the default option value for a specific - filetype. This is a wrapper around |nvim_get_option_value()| with caching. - -• Added |nvim_get_hl()| for getting highlight group definitions in a format compatible with |nvim_set_hl()|. - -• |vim.diagnostic| now supports LSP DiagnosticsTag. - See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticTag +• ... ============================================================================== -CHANGED FEATURES *news-changes* +CHANGED FEATURES *news-changed* The following changes to existing APIs or features add new behavior. -• 'exrc' now supports `.nvim.lua` file. -• 'exrc' is no longer marked deprecated. - -• The |TUI| is changed to run in a separate process (previously, a separate - thread was used). This is not supposed to be a visible change to the user, - but might be the cause of subtle changes of behavior and bugs. - - Previously, the TUI could be disabled as a build time feature (+tui/-tui), - resulting in a nvim binary which only could be run headless or embedded - in an external process. As of this version, TUI is always available. - -• API calls now show more information about where an exception happened. - -• The `win_viewport` UI event now contains information about virtual lines, - meaning that smooth scrolling can now be implemented more consistenlty. - -• The `:= {expr}` syntax can be used to evaluate a lua expression, as - a shorter form of `:lua ={expr}`. `:=` and `:[range]=` without argument - are unchanged. However `:=#` and similar variants using |ex-flags| - are no longer supported. +• ... ============================================================================== REMOVED FEATURES *news-removed* The following deprecated functions or APIs were removed. -• It is no longer possible to scroll the whole screen when showing messages - longer than 'cmdheight'. |msgsep| is now always enabled even if 'display' - doesn't contain the "msgsep" flag. - -• `filetype.vim` is removed in favor of |lua-filetype| - (Note that filetype logic and tests still align with Vim, so additions or - changes need to be contributed there first.) - See https://github.com/neovim/neovim/pull/20674. - -• 'hkmap', 'hkmapp' and 'aleph' options were removed. Use 'keymap' option instead. - -• |LanguageTree:parse()| no longer returns changed regions. Please use the - `on_changedtree` callbacks instead. - -• `vim.highlight.create()`, `vim.highlight.link()` were removed, use |nvim_set_hl()| instead. - -• `require'health'` was removed. Use |vim.health| instead. +• ... ============================================================================== DEPRECATIONS *news-deprecations* @@ -295,27 +45,7 @@ DEPRECATIONS *news-deprecations* The following functions are now deprecated and will be removed in the next release. -• |vim.treesitter.language.add()| replaces `vim.treesitter.language.require_language()` - -• |vim.treesitter.get_node_at_pos()| and |vim.treesitter.get_node_at_cursor()| - are both deprecated in favor of |vim.treesitter.get_node()|. - -• `vim.api.nvim_get_hl_by_name()`, `vim.api.nvim_get_hl_by_id()` were deprecated, use |nvim_get_hl()| instead. +• ... -• The following top level Treesitter functions have been moved: - `vim.treesitter.inspect_language()` -> `vim.treesitter.language.inspect()` - `vim.treesitter.get_query_files()` -> `vim.treesitter.query.get_files()` - `vim.treesitter.set_query()` -> `vim.treesitter.query.set()` - `vim.treesitter.query.set_query()` -> `vim.treesitter.query.set()` - `vim.treesitter.get_query()` -> `vim.treesitter.query.get()` - `vim.treesitter.query.get_query()` -> `vim.treesitter.query.get()` - `vim.treesitter.parse_query()` -> `vim.treesitter.query.parse()` - `vim.treesitter.query.parse_query()` -> `vim.treesitter.query.parse()` - `vim.treesitter.add_predicate()` -> `vim.treesitter.query.add_predicate()` - `vim.treesitter.add_directive()` -> `vim.treesitter.query.add_directive()` - `vim.treesitter.list_predicates()` -> `vim.treesitter.query.list_predicates()` - `vim.treesitter.list_directives()` -> `vim.treesitter.query.list_directives()` - `vim.treesitter.query.get_range()` -> `vim.treesitter.get_range()` - `vim.treesitter.query.get_node_text()` -> `vim.treesitter.get_node_text()` vim:tw=78:ts=8:sw=2:et:ft=help:norl: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 096b334cda..d22a78700f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4846,7 +4846,7 @@ A jump table for the options with a short description can be found at |Q_op|. pack/ packages |:packadd| parser/ |treesitter| syntax parsers plugin/ plugin scripts |write-plugin| - query/ |treesitter| queries + queries/ |treesitter| queries rplugin/ |remote-plugin| scripts spell/ spell checking files |spell| syntax/ syntax files |mysyntaxfile| @@ -7256,7 +7256,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'writedelay'* *'wd'* 'writedelay' 'wd' number (default 0) global - Only takes effect toghether with 'redrawdebug'. + Only takes effect together with 'redrawdebug'. The number of milliseconds to wait after each line or each flush vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index 5ba5d1beef..2ae93b098a 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -105,7 +105,7 @@ with your plugin name: > local M = {} M.check = function() - vim.health.report_start("my_plugin report") + vim.health.report_start("foo report") -- make sure setup function parameters are ok if check_setup() then vim.health.report_ok("Setup is correct") diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 801ea77b7f..b3a30b20e8 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -242,7 +242,7 @@ argument. *-ll* -ll {script} [args] Execute a lua script, similarly to |-l|, but the editor is not - initialized. This gives a lua enviroment similar to a worker + initialized. This gives a lua environment similar to a worker thread. See |lua-loop-threading|. Unlike `-l` no prior arguments are allowed. @@ -1394,7 +1394,7 @@ result in Neovim looking for configuration files in `$XDG_CONFIG_HOME/neovim` instead of `$XDG_CONFIG_HOME/nvim`. Note: Similarly to the $XDG environment variables, when -`$XDG_CONFIG_HOME/nvim` is mentionned, it should be understood as +`$XDG_CONFIG_HOME/nvim` is mentioned, it should be understood as `$XDG_CONFIG_HOME/$NVIM_APPNAME`. LOG FILE *log* *$NVIM_LOG_FILE* *E5430* diff --git a/runtime/doc/support.txt b/runtime/doc/support.txt index e4641751f2..80a035068a 100644 --- a/runtime/doc/support.txt +++ b/runtime/doc/support.txt @@ -14,7 +14,7 @@ Supported platforms *supported-platforms* `System` `Tier` `Versions` `Tested versions` Linux 1 >= 2.6.32, glibc >= 2.12 Ubuntu 22.04 macOS (Intel) 1 >= 10.15 macOS 12 -Windows 64-bit 1 >= 8 (see note below) Windows Server 2019 +Windows 64-bit 1 >= 8 (see note below) Windows Server 2022 FreeBSD 1 >= 10 FreeBSD 13 macOS (M1) 2 >= 10.15 OpenBSD 2 >= 7 diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 0298f5a9b1..dc1afe89f8 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -1164,4 +1164,12 @@ LanguageTree:trees({self}) *LanguageTree:trees()* Parameters: ~ • {self} + +============================================================================== +Lua module: vim.treesitter.playground *lua-treesitter-playground* + +inspect_tree({opts}) *vim.treesitter.playground.inspect_tree()* + Parameters: ~ + • {opts} InspectTreeOpts + vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 8244ae4230..7b0e724e31 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -32,7 +32,8 @@ CTRL-L Clears and redraws the screen. The redraw may happen *:redraws* *:redrawstatus* :redraws[tatus][!] Redraws the status line and window bar of the current window, or all status lines and window bars if "!" is - included. Useful if 'statusline' or 'winbar' includes + included. Redraws the commandline instead if it contains + the 'ruler'. Useful if 'statusline' or 'winbar' includes an item that doesn't cause automatic updating. *:redrawt* *:redrawtabline* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index d6ad9107b3..7228473676 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -255,6 +255,8 @@ Highlight groups: |hl-TermCursorNC| |hl-WinSeparator| highlights window separators |hl-Whitespace| highlights 'listchars' whitespace + |hl-WinBar| highlights 'winbar' + |hl-WinBarNC| highlights non-current window 'winbar' Input/Mappings: ALT (|META|) chords always work (even in the |TUI|). Map |<M-| with any key: @@ -494,8 +496,10 @@ Macro/|recording| behavior the results of keys from 'keymap'. Mappings: - Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an +- Creating a mapping for a simplifiable key (e.g. <C-I>) doesn't replace an existing mapping for its simplified form (e.g. <Tab>). +- "#" followed by a digit doesn't stand for a function key at the start of the + lhs of a mapping. Motion: The |jumplist| avoids useless/phantom jumps. |