mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 18:54:18 +00:00
Merge #38882 docs
This commit is contained in:
@@ -397,6 +397,7 @@ CTRL-D List names that match the pattern in front of the cursor.
|
||||
to the end.
|
||||
The 'wildoptions' option can be set to "tagfile" to list the
|
||||
file of matching tags.
|
||||
|
||||
*c_CTRL-I* *c_wildchar* *c_<Tab>* */_<Tab>*
|
||||
'wildchar' option
|
||||
A match is done on the pattern in front of the cursor. The
|
||||
@@ -412,20 +413,25 @@ CTRL-D List names that match the pattern in front of the cursor.
|
||||
literal <Tab> instead of triggering completion.
|
||||
|
||||
The behavior can be changed with the 'wildmode' option.
|
||||
|
||||
*c_<S-Tab>*
|
||||
<S-Tab> Like 'wildchar' or <Tab>, but begin with the last match and
|
||||
then go to the previous match.
|
||||
|
||||
*c_CTRL-N*
|
||||
CTRL-N After using 'wildchar' which got multiple matches, go to next
|
||||
match. Otherwise recall more recent command-line from
|
||||
history.
|
||||
|
||||
*c_CTRL-P*
|
||||
CTRL-P After using 'wildchar' which got multiple matches, go to
|
||||
previous match. Otherwise recall older command-line from
|
||||
history.
|
||||
|
||||
*c_CTRL-A*
|
||||
CTRL-A All names that match the pattern in front of the cursor are
|
||||
inserted.
|
||||
|
||||
*c_CTRL-L*
|
||||
CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
there is one match, it is inserted in place of the pattern.
|
||||
@@ -439,19 +445,22 @@ CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
'ignorecase' and 'smartcase' are set and the command line has
|
||||
no uppercase characters, the added character is converted to
|
||||
lowercase.
|
||||
|
||||
*c_CTRL-G* */_CTRL-G*
|
||||
CTRL-G When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-G will move
|
||||
to the next match (does not take |search-offset| into account)
|
||||
Use CTRL-T to move to the previous match. Hint: on a regular
|
||||
keyboard G is below T.
|
||||
CTRL-G While the "/" or "?" 'incsearch' prompt is active, CTRL-G
|
||||
moves to the next match (without changing the |jumplist|).
|
||||
Does not take |search-offset| into account.
|
||||
|
||||
Use CTRL-T to move to the previous match.
|
||||
Mnemonic: on a regular keyboard G is below T.
|
||||
|
||||
*c_CTRL-T* */_CTRL-T*
|
||||
CTRL-T When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-T will move
|
||||
to the previous match (does not take |search-offset| into
|
||||
account).
|
||||
Use CTRL-G to move to the next match. Hint: on a regular
|
||||
keyboard T is above G.
|
||||
CTRL-T While the "/" or "?" 'incsearch' prompt is active, CTRL-T
|
||||
moves to the previous match (without changing the |jumplist|).
|
||||
Does not take |search-offset| into account.
|
||||
|
||||
Use CTRL-G to move to the next match.
|
||||
Mnemonic: on a regular keyboard T is above G.
|
||||
|
||||
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
||||
a previous version <Esc> was used). In the pattern standard |wildcards| are
|
||||
|
||||
@@ -69,9 +69,11 @@ Lua code lives in one of four places:
|
||||
- ❌ nvim.difftool
|
||||
- ❌ nvim.tohtml
|
||||
- ❌ nvim.undotree
|
||||
2. Runtime: `runtime/lua/vim/`. Lazy-loaded modules. Examples: `treesitter`, `lpeg`.
|
||||
3. Core: `runtime/lua/vim/_core/`. Compiled-into Nvim binary, may directly
|
||||
interact with Nvim internals. Only available in the main thread. See
|
||||
2. Stdlib: `runtime/lua/vim/`. Modules on `vim.*`, lazy-loaded (as opposed to
|
||||
"Core" modules, see below).
|
||||
- Examples: `vim.treesitter`, `vim.lpeg`.
|
||||
3. Core: `runtime/lua/vim/_core/`. Internal-only, compiled-in modules. May
|
||||
directly interact with Nvim internals. Only available in main thread. See
|
||||
|dev-lua-builtin| below.
|
||||
4. "Shared" core: `runtime/lua/vim/_core/shared.lua`. Pure Lua functions which
|
||||
always are available. Used in the test runner, and worker threads/processes
|
||||
|
||||
@@ -4198,12 +4198,12 @@ vim.net.request({url}, {opts}, {on_response}) *vim.net.request()*
|
||||
result to the specified `on_response`, `outpath` or `outbuf`.
|
||||
|
||||
Examples: >lua
|
||||
-- Write response body to file
|
||||
-- Write response body to file.
|
||||
vim.net.request('https://neovim.io/charter/', {
|
||||
outpath = 'vision.html',
|
||||
})
|
||||
|
||||
-- Process the response
|
||||
-- Process the response.
|
||||
vim.net.request(
|
||||
'https://api.github.com/repos/neovim/neovim',
|
||||
{},
|
||||
@@ -4214,14 +4214,14 @@ vim.net.request({url}, {opts}, {on_response}) *vim.net.request()*
|
||||
end
|
||||
)
|
||||
|
||||
-- Write to both file and current buffer, but cancel it
|
||||
-- Write to both file and current buffer, but cancel it.
|
||||
local job = vim.net.request('https://neovim.io/charter/', {
|
||||
outpath = 'vision.html',
|
||||
outbuf = 0,
|
||||
})
|
||||
job:close()
|
||||
|
||||
-- Add custom headers in the request
|
||||
-- Add custom headers in the request.
|
||||
vim.net.request('https://neovim.io/charter/', {
|
||||
headers = { Authorization = 'Bearer XYZ' },
|
||||
})
|
||||
@@ -4237,19 +4237,19 @@ vim.net.request({url}, {opts}, {on_response}) *vim.net.request()*
|
||||
body to.
|
||||
• {outbuf}? (`integer`) Buffer to save the response
|
||||
body to.
|
||||
• {headers}? (`table<string, string>`) Table of custom
|
||||
headers to send with the request. Supports basic
|
||||
key/value header formats and empty headers as
|
||||
supported by curl. Does not support @filename style,
|
||||
internal header deletion (e.g: 'Header:').
|
||||
• {headers}? (`table<string, string>`) Custom headers
|
||||
to send with the request. Supports basic key/value
|
||||
headers and empty headers as supported by curl. Does
|
||||
not support "@filename" style, internal header
|
||||
deletion ("Header:").
|
||||
• {on_response} (`fun(err: string?, response: vim.net.request.Response?)?`)
|
||||
Callback invoked on request completion. The `body`
|
||||
field in the response parameter contains the raw
|
||||
response data (text or binary).
|
||||
|
||||
Return: ~
|
||||
(`{ close: fun() }`) Table with method to cancel, similar to
|
||||
|vim.SystemObj|.
|
||||
(`{ close: fun() }`) Object with `close()` method which cancels the
|
||||
request.
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -4270,8 +4270,8 @@ by |vim.Pos| objects.
|
||||
To create a new |vim.Pos| object, call `vim.pos()`.
|
||||
|
||||
Example: >lua
|
||||
local pos1 = vim.pos(3, 5)
|
||||
local pos2 = vim.pos(4, 0)
|
||||
local pos1 = vim.pos(vim.api.nvim_get_current_buf(), 3, 5)
|
||||
local pos2 = vim.pos(vim.api.nvim_get_current_buf(), 4, 0)
|
||||
|
||||
-- Operators are overloaded for comparing two `vim.Pos` objects.
|
||||
if pos1 < pos2 then
|
||||
@@ -4320,7 +4320,7 @@ Pos:to_lsp({position_encoding}) *Pos:to_lsp()*
|
||||
local pos = vim.pos(buf, 3, 5)
|
||||
|
||||
-- Convert to LSP position, you can call it in a method style.
|
||||
local lsp_pos = pos:lsp('utf-16')
|
||||
local lsp_pos = pos:to_lsp('utf-16')
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
@@ -4390,13 +4390,13 @@ Provides operations to compare, calculate, and convert ranges represented by
|
||||
format conversions.
|
||||
|
||||
Example: >lua
|
||||
local pos1 = vim.pos(3, 5)
|
||||
local pos2 = vim.pos(4, 0)
|
||||
local pos1 = vim.pos(vim.api.nvim_get_current_buf(), 3, 5)
|
||||
local pos2 = vim.pos(vim.api.nvim_get_current_buf(), 4, 0)
|
||||
|
||||
-- Create a range from two positions.
|
||||
local range1 = vim.range(pos1, pos2)
|
||||
-- Or create a range from four integers representing start and end positions.
|
||||
local range2 = vim.range(3, 5, 4, 0)
|
||||
local range2 = vim.range(vim.api.nvim_get_current_buf(), 3, 5, 4, 0)
|
||||
|
||||
-- Because `vim.Range` is end exclusive, `range1` and `range2` both represent
|
||||
-- a range starting at the row 3, column 5 and ending at where the row 3 ends
|
||||
|
||||
@@ -10,6 +10,52 @@ For changes in the previous release, see |news-0.12|.
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
BREAKING CHANGES IN HEAD OR EXPERIMENTAL *news-breaking-dev*
|
||||
|
||||
====== Remove this section before release. ======
|
||||
|
||||
The following changes to UNRELEASED features were made during the development
|
||||
cycle (Nvim HEAD, the "master" branch).
|
||||
|
||||
EVENTS
|
||||
|
||||
• todo
|
||||
|
||||
EXPERIMENTS
|
||||
|
||||
• todo
|
||||
|
||||
LSP
|
||||
|
||||
• todo
|
||||
|
||||
LUA
|
||||
|
||||
|
||||
• vim.pos, vim.range always require the `buf` parameter.
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
• todo
|
||||
|
||||
OPTIONS
|
||||
|
||||
• todo
|
||||
|
||||
TREESITTER
|
||||
|
||||
• todo
|
||||
|
||||
UI
|
||||
|
||||
• todo
|
||||
|
||||
VIMSCRIPT
|
||||
|
||||
• todo
|
||||
|
||||
|
||||
==============================================================================
|
||||
BREAKING CHANGES *news-breaking*
|
||||
|
||||
@@ -20,7 +66,6 @@ API
|
||||
• |nvim_create_autocmd()|, |nvim_exec_autocmds()| and |nvim_clear_autocmds()|
|
||||
no longer treat an empty non-nil pattern as nil.
|
||||
• |nvim_clear_autocmds()| no longer treats an empty array event as nil.
|
||||
• `stdpath("log")` moved to `stdpath("state")/logs`.
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
@@ -28,7 +73,7 @@ DIAGNOSTICS
|
||||
|
||||
EDITOR
|
||||
|
||||
• todo
|
||||
• `stdpath("log")` moved to `stdpath("state")/logs`.
|
||||
|
||||
EVENTS
|
||||
|
||||
@@ -61,11 +106,7 @@ The following new features were added.
|
||||
|
||||
API
|
||||
|
||||
• |vim.lsp.buf.declaration()|, |vim.lsp.buf.definition()|, |vim.lsp.buf.definition()|,
|
||||
and |vim.lsp.buf.implementation()| now follows 'switchbuf'.
|
||||
|
||||
• |vim.net.request()| opts field now accepts a headers table, with custom
|
||||
header support.
|
||||
• todo
|
||||
|
||||
BUILD
|
||||
|
||||
@@ -81,7 +122,7 @@ DIAGNOSTICS
|
||||
|
||||
EDITOR
|
||||
|
||||
• |:log| for opening log files
|
||||
• |:log| opens log files.
|
||||
|
||||
EVENTS
|
||||
|
||||
@@ -95,19 +136,21 @@ LSP
|
||||
|
||||
• LSP capabilities:
|
||||
• `textDocument/foo` …
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_codeLens
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_foo
|
||||
• `textDocument/bar` …
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_colorPresentation
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_bar
|
||||
• |vim.lsp.buf.declaration()|, |vim.lsp.buf.definition()|, |vim.lsp.buf.definition()|,
|
||||
and |vim.lsp.buf.implementation()| now follows 'switchbuf'.
|
||||
• Support for nested snippets.
|
||||
|
||||
LUA
|
||||
|
||||
• |vim.net.request()| can specify custom headers by passing `opts.headers`.
|
||||
• |vim.filetype.inspect()| returns a copy of the internal tables used for
|
||||
filetype detection.
|
||||
• Added `__eq` metamethod to |vim.VersionRange|. 2 distinct but representing
|
||||
the same range instances now compare equal.
|
||||
|
||||
|
||||
OPTIONS
|
||||
|
||||
• todo
|
||||
|
||||
@@ -6335,8 +6335,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
%-0{minwid}.{maxwid}{item}
|
||||
<
|
||||
All fields except {item} are optional. Use "%%" to show a literal "%"
|
||||
char. Setting this option to empty (`:set statusline=`) sets its
|
||||
value to the default.
|
||||
char. Setting to empty (`:set statusline=`) sets the global value to
|
||||
the default.
|
||||
|
||||
*stl-%!*
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Plugins and modules included with Nvim *plugins*
|
||||
Plugins and modules included with Nvim *standard-plugin*
|
||||
|
||||
Nvim includes various Lua and Vim plugins or modules which may provide
|
||||
commands (such as :TOhtml) or modules that you can optionally require() or
|
||||
|
||||
@@ -276,7 +276,7 @@ The global plugins will be discussed first, then the filetype ones
|
||||
|add-filetype-plugin|.
|
||||
|
||||
|
||||
GLOBAL PLUGINS *standard-plugin*
|
||||
GLOBAL PLUGINS
|
||||
|
||||
When you start Vim, it will automatically load a number of global plugins.
|
||||
You don't have to do anything for this. They add functionality that most
|
||||
|
||||
@@ -233,9 +233,9 @@ For other ways to count words, lines and other items, see |count-items|.
|
||||
==============================================================================
|
||||
*12.6* Find a man page *find-manpage*
|
||||
|
||||
While editing a shell script or C program, you are using a command or function
|
||||
that you want to find the man page for (this is on Unix). Let's first use a
|
||||
simple way: Move the cursor to the word you want to find help on and press >
|
||||
While editing a C program, you are using a function that you want to find the
|
||||
man page for (this is on Unix). Let's first use a simple way: Move the cursor
|
||||
to the word you want to find help on and press >
|
||||
|
||||
K
|
||||
|
||||
|
||||
@@ -3653,7 +3653,7 @@ getfsize({fname}) *getfsize()*
|
||||
(`integer`)
|
||||
|
||||
getftime({fname}) *getftime()*
|
||||
Returns the last modification time of the given file {fname}.
|
||||
Returns the last modification time ("mtime") of file {fname}.
|
||||
The value is measured as seconds since 1st Jan 1970, and may
|
||||
be passed to |strftime()|. See also
|
||||
|localtime()| and |strftime()|.
|
||||
|
||||
Reference in New Issue
Block a user