Skip to content

Commit 5ceb223

Browse files
authored
Merge neovim#24116 from justinmk/doc
2 parents e59cf3b + 49a7585 commit 5ceb223

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1574
-1700
lines changed

runtime/doc/api.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ any of these approaches:
209209
nvim --api-info | python -c 'import msgpack, sys, yaml; yaml.dump(msgpack.unpackb(sys.stdin.buffer.read()), sys.stdout)'
210210
<
211211
3. Use the |api_info()| Vimscript function. >vim
212-
:lua print(vim.inspect(vim.fn.api_info()))
212+
:lua vim.print(vim.fn.api_info())
213213
< Example using |filter()| to exclude non-deprecated API functions: >vim
214214
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val.name')
215215

@@ -2030,7 +2030,7 @@ whether a buffer is loaded.
20302030
nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
20312031
Activates buffer-update events on a channel, or as Lua callbacks.
20322032

2033-
Example (Lua): capture buffer updates in a global `events` variable (use "print(vim.inspect(events))" to see its contents): >lua
2033+
Example (Lua): capture buffer updates in a global `events` variable (use "vim.print(events)" to see its contents): >lua
20342034
events = {}
20352035
vim.api.nvim_buf_attach(0, false, {
20362036
on_lines=function(...) table.insert(events, {...}) end})
@@ -2554,7 +2554,7 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
25542554
local ms = api.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {})
25552555
-- Get all marks in this buffer + namespace.
25562556
local all = api.nvim_buf_get_extmarks(0, ns, 0, -1, {})
2557-
print(vim.inspect(ms))
2557+
vim.print(ms)
25582558
<
25592559

25602560
Parameters: ~

runtime/doc/autocmd.txt

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -212,28 +212,27 @@ events.
212212
Nvim recognizes the following events. Names are case-insensitive.
213213

214214
*BufAdd*
215-
BufAdd Just after creating a new buffer which is
216-
added to the buffer list, or adding a buffer
217-
to the buffer list, a buffer in the buffer
218-
list was renamed.
219-
Not triggered for the initial buffers created
220-
during startup.
215+
BufAdd After adding a new buffer or existing unlisted
216+
buffer to the buffer list (except during
217+
startup, see |VimEnter|), or renaming a listed
218+
buffer.
221219
Before |BufEnter|.
222-
NOTE: Current buffer "%" may be different from
223-
the buffer being created "<afile>".
220+
NOTE: Current buffer "%" is not the target
221+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
224222
*BufDelete*
225223
BufDelete Before deleting a buffer from the buffer list.
226224
The BufUnload may be called first (if the
227225
buffer was loaded).
228226
Also used just before a buffer in the buffer
229227
list is renamed.
230-
NOTE: Current buffer "%" may be different from
231-
the buffer being deleted "<afile>" and "<abuf>".
228+
NOTE: Current buffer "%" is not the target
229+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
232230
Do not change to another buffer.
233231
*BufEnter*
234-
BufEnter After entering a buffer. Useful for setting
235-
options for a file type. Also executed when
236-
starting to edit a buffer.
232+
BufEnter After entering (visiting, switching-to) a new
233+
or existing buffer. Useful for setting
234+
filetype options. Compare |BufNew| which
235+
does not trigger for existing buffers.
237236
After |BufAdd|.
238237
After |BufReadPost|.
239238
*BufFilePost*
@@ -248,8 +247,8 @@ BufHidden Before a buffer becomes hidden: when there are
248247
the buffer is not unloaded or deleted.
249248

250249
Not used for ":qa" or ":q" when exiting Vim.
251-
NOTE: current buffer "%" may be different from
252-
the buffer being unloaded "<afile>".
250+
NOTE: Current buffer "%" is not the target
251+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
253252
*BufLeave*
254253
BufLeave Before leaving to another buffer. Also when
255254
leaving or closing the current window and the
@@ -260,12 +259,14 @@ BufLeave Before leaving to another buffer. Also when
260259
BufModifiedSet After the `'modified'` value of a buffer has
261260
been changed.
262261
*BufNew*
263-
BufNew Just after creating a new buffer. Also used
264-
just after a buffer has been renamed. When
265-
the buffer is added to the buffer list BufAdd
266-
will be triggered too.
267-
NOTE: Current buffer "%" may be different from
268-
the buffer being created "<afile>".
262+
BufNew After creating a new buffer (except during
263+
startup, see |VimEnter|) or renaming an
264+
existing buffer. Unlike |BufEnter|, visiting
265+
(switching to) an existing buffer will not
266+
trigger this again.
267+
NOTE: Current buffer "%" is not the target
268+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
269+
See also |BufAdd|, |BufNewFile|.
269270
*BufNewFile*
270271
BufNewFile When starting to edit a file that doesn't
271272
exist. Can be used to read in a skeleton
@@ -298,8 +299,8 @@ BufUnload Before unloading a buffer, when the text in
298299
Before BufDelete.
299300
Triggers for all loaded buffers when Vim is
300301
going to exit.
301-
NOTE: Current buffer "%" may be different from
302-
the buffer being unloaded "<afile>".
302+
NOTE: Current buffer "%" is not the target
303+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
303304
Do not switch buffers or windows!
304305
Not triggered when exiting and v:dying is 2 or
305306
more.
@@ -319,8 +320,8 @@ BufWinLeave Before a buffer is removed from a window.
319320
Not when it's still visible in another window.
320321
Also triggered when exiting.
321322
Before BufUnload, BufHidden.
322-
NOTE: Current buffer "%" may be different from
323-
the buffer being unloaded "<afile>".
323+
NOTE: Current buffer "%" is not the target
324+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
324325
Not triggered when exiting and v:dying is 2 or
325326
more.
326327
*BufWipeout*
@@ -330,8 +331,8 @@ BufWipeout Before completely deleting a buffer. The
330331
buffer list). Also used just before a buffer
331332
is renamed (also when it's not in the buffer
332333
list).
333-
NOTE: Current buffer "%" may be different from
334-
the buffer being deleted "<afile>".
334+
NOTE: Current buffer "%" is not the target
335+
buffer "<afile>", "<abuf>". |<buffer=abuf>|
335336
Do not change to another buffer.
336337
*BufWrite* *BufWritePre*
337338
BufWrite or BufWritePre Before writing the whole buffer to a file.
@@ -597,8 +598,8 @@ FileChangedShell When Vim notices that the modification time of
597598
prompt is not given.
598599
|v:fcs_reason| indicates what happened. Set
599600
|v:fcs_choice| to control what happens next.
600-
NOTE: Current buffer "%" may be different from
601-
the buffer that was changed "<afile>".
601+
NOTE: Current buffer "%" is not the target
602+
buffer "<afile>" and "<abuf>". |<buffer=abuf>|
602603
*E246* *E811*
603604
Cannot switch, jump to or delete buffers.
604605
Non-recursive (event cannot trigger itself).

runtime/doc/builtin.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ api_info() *api_info()*
656656
Returns Dictionary of |api-metadata|.
657657

658658
View it in a nice human-readable format: >
659-
:lua print(vim.inspect(vim.fn.api_info()))
659+
:lua vim.print(vim.fn.api_info())
660660
661661
append({lnum}, {text}) *append()*
662662
When {text} is a |List|: Append each item of the |List| as a
@@ -1939,7 +1939,7 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is
19391939
$ENVNAME environment variable (could also be
19401940
done by comparing with an empty
19411941
string)
1942-
*funcname built-in function (see |functions|)
1942+
`*funcname` built-in function (see |functions|)
19431943
or user defined function (see
19441944
|user-function|). Also works for a
19451945
variable that is a Funcref.
@@ -3019,7 +3019,7 @@ getcmdtype() *getcmdtype()*
30193019
/ forward search command
30203020
? backward search command
30213021
@ |input()| command
3022-
- |:insert| or |:append| command
3022+
`-` |:insert| or |:append| command
30233023
= |i_CTRL-R_=|
30243024
Only works when editing the command line, thus requires use of
30253025
|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
@@ -3364,20 +3364,26 @@ getmatches([{win}]) *getmatches()*
33643364
If {win} is specified, use the window with this number or
33653365
window ID instead of the current window. If {win} is invalid,
33663366
an empty list is returned.
3367-
Example: >
3367+
Example: >vim
33683368
:echo getmatches()
3369-
< [{"group": "MyGroup1", "pattern": "TODO",
3369+
>
3370+
[{"group": "MyGroup1", "pattern": "TODO",
33703371
"priority": 10, "id": 1}, {"group": "MyGroup2",
3371-
"pattern": "FIXME", "priority": 10, "id": 2}] >
3372+
"pattern": "FIXME", "priority": 10, "id": 2}]
3373+
>vim
33723374
:let m = getmatches()
33733375
:call clearmatches()
33743376
:echo getmatches()
3375-
< [] >
3377+
>
3378+
[]
3379+
>vim
33763380
:call setmatches(m)
33773381
:echo getmatches()
3378-
< [{"group": "MyGroup1", "pattern": "TODO",
3382+
>
3383+
[{"group": "MyGroup1", "pattern": "TODO",
33793384
"priority": 10, "id": 1}, {"group": "MyGroup2",
3380-
"pattern": "FIXME", "priority": 10, "id": 2}] >
3385+
"pattern": "FIXME", "priority": 10, "id": 2}]
3386+
>vim
33813387
:unlet m
33823388
<
33833389
getmousepos() *getmousepos()*
@@ -8268,7 +8274,7 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
82688274
Funcref `function('name')`
82698275
Blob 0z00112233.44556677.8899
82708276
List [item, item]
8271-
Dictionary {key: value, key: value}
8277+
Dictionary `{key: value, key: value}`
82728278
Note that in String values the ' character is doubled.
82738279
Also see |strtrans()|.
82748280
Note 2: Output format is mostly compatible with YAML, except

runtime/doc/change.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ white space). Three types of comments can be used:
14901490
lines. An example is this list with dashes.
14911491
- Three-piece comments that have a start string, an end string, and optional
14921492
lines in between. The strings for the start, middle and end are different.
1493-
An example is the C style comment:
1493+
An example is the C style comment: >
14941494
/*
14951495
* this is a C comment
14961496
*/
@@ -1565,20 +1565,20 @@ When you hit Return in a C-comment, Vim will insert the middle comment leader
15651565
for the new line: " * ". To close this comment you just have to type "/"
15661566
before typing anything else on the new line. This will replace the
15671567
middle-comment leader with the end-comment leader and apply any specified
1568-
alignment, leaving just " */". There is no need to hit Backspace first.
1568+
alignment, leaving just `" */"`. There is no need to hit Backspace first.
15691569

15701570
When there is a match with a middle part, but there also is a matching end
15711571
part which is longer, the end part is used. This makes a C style comment work
15721572
without requiring the middle part to end with a space.
15731573

15741574
Here is an example of alignment flags at work to make a comment stand out
1575-
(kind of looks like a 1 too). Consider comment string: >
1575+
(kind of looks like a 1 too). Consider comment string: >vim
15761576
:set comments=sr:/***,m:**,ex-2:******/
1577-
<
1577+
>
15781578
/*** ~
15791579
**<--right aligned from "r" flag ~
15801580
** ~
1581-
offset 2 spaces for the "-2" flag--->** ~
1581+
offset 2 spaces for the "-2" flag-->** ~
15821582
******/ ~
15831583
In this case, the first comment was typed, then return was pressed 4 times,
15841584
then "/" was pressed to end the comment.
@@ -1741,10 +1741,10 @@ happens with formatting and auto-wrapping. Opening a line after a line
17411741
starting with "/*" or "*" and containing "*/", will cause no comment leader to
17421742
be inserted, and the indent of the new line is taken from the line containing
17431743
the start of the comment.
1744-
E.g.:
1745-
/* ~
1746-
* Your typical comment. ~
1747-
*/ ~
1744+
E.g.: >
1745+
/*
1746+
* Your typical comment.
1747+
*/
17481748
The indent on this line is the same as the start of the above
17491749
comment.
17501750

runtime/doc/cmdline.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ CTRL-E or <End> *c_CTRL-E* *c_<End>* *c_End*
100100

101101
*c_<MiddleMouse>*
102102
<MiddleMouse> Paste the contents of the clipboard (for X11 the primary
103-
selection). This is similar to using CTRL-R *, but no CR
103+
selection). This is similar to using `CTRL-R *`, but no CR
104104
characters are inserted between lines.
105105

106106
CTRL-H *c_<BS>* *c_CTRL-H* *c_BS*
@@ -190,8 +190,8 @@ CTRL-R CTRL-L *c_CTRL-R_CTRL-L* *c_<C-R>_<C-L>*
190190

191191
*c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
192192
*c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
193-
CTRL-R CTRL-R {register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
194-
CTRL-R CTRL-O {register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}
193+
CTRL-R CTRL-R `{register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}`
194+
CTRL-R CTRL-O `{register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}`
195195
Insert register or object under the cursor. Works like
196196
|c_CTRL-R| but inserts the text literally. For example, if
197197
register a contains "xy^Hz" (where ^H is a backspace),
@@ -1058,7 +1058,7 @@ But expansion is only done if there are any wildcards before expanding the
10581058
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
10591059
want to expand the result of <cfile>, add a wildcard character to it.
10601060
Examples: (alternate file name is "?readme?")
1061-
command expands to ~
1061+
command expands to >
10621062
:e # :e ?readme?
10631063
:e `ls #` :e {files matching "?readme?"}
10641064
:e #.* :e {files matching "?readme?.*"}
@@ -1230,6 +1230,6 @@ The character used for the pattern indicates the type of command-line:
12301230
? backward search string
12311231
= expression for "= |expr-register|
12321232
@ string for |input()|
1233-
- text for |:insert| or |:append|
1233+
`-` text for |:insert| or |:append|
12341234

12351235
vim:tw=78:ts=8:noet:ft=help:norl:

runtime/doc/deprecated.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ LSP FUNCTIONS
130130
- *vim.lsp.util.set_qflist()* Use |setqflist()| instead.
131131
- *vim.lsp.util.set_loclist()* Use |setloclist()| instead.
132132
- *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
133-
{buffer = bufnr} instead.
133+
{buffer=bufnr} instead.
134134
- *vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with
135-
{async = true} instead.
135+
{async=true} instead.
136136
- *vim.lsp.buf.formatting_sync()* Use |vim.lsp.buf.format()| with
137-
{async = false} instead.
137+
{async=false} instead.
138138
- *vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()|
139139
or |vim.lsp.buf.format()| instead.
140140
- *vim.lsp.util.get_progress_messages()* Use |vim.lsp.status()| or access

0 commit comments

Comments
 (0)