Skip to content

Commit fc3c204

Browse files
veotoschrisbra
authored andcommitted
runtime(doc): Fix style and typos in builtin.txt and usr_41.txt
- Reformat parts to fit into 80 column window. - Fix example with mandatory call with a range. vim/vim#17950 (comment) - Remove some duplicate information closes: #17949 Signed-off-by: veotos <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 8e2a229 commit fc3c204

2 files changed

Lines changed: 34 additions & 26 deletions

File tree

runtime/doc/builtin.txt

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 08
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -6556,7 +6556,7 @@ libcall({libname}, {funcname}, {argument})
65566556
libcallnr({libname}, {funcname}, {argument})
65576557
Just like |libcall()|, but used for a function that returns an
65586558
int instead of a string.
6559-
{only in Win32 on some Unix versions, when the |+libcall|
6559+
{only in Win32 and some Unix versions, when the |+libcall|
65606560
feature is present}
65616561
Examples: >
65626562
:echo libcallnr("/usr/lib/libc.so", "getpid", "")
@@ -7350,14 +7350,16 @@ matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}])
73507350
[{'lnum': 3, 'byteidx': 0, 'text': 'a'}]
73517351
" Assuming line 4 in buffer 10 contains "tik tok"
73527352
:echo matchbufline(10, '\<\k\+\>', 1, 4)
7353-
[{'lnum': 4, 'byteidx': 0, 'text': 'tik'}, {'lnum': 4, 'byteidx': 4, 'text': 'tok'}]
7353+
[{'lnum': 4, 'byteidx': 0, 'text': 'tik'},
7354+
{'lnum': 4, 'byteidx': 4, 'text': 'tok'}]
73547355
<
73557356
If {submatch} is present and is v:true, then submatches like
73567357
"\1", "\2", etc. are also returned. Example: >
73577358
" Assuming line 2 in buffer 2 contains "acd"
73587359
:echo matchbufline(2, '\(a\)\?\(b\)\?\(c\)\?\(.*\)', 2, 2
73597360
\ {'submatches': v:true})
7360-
[{'lnum': 2, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
7361+
[{'lnum': 2, 'byteidx': 0, 'text': 'acd', 'submatches':
7362+
['a', '', 'c', 'd', '', '', '', '', '']}]
73617363
< The "submatches" List always contains 9 items. If a submatch
73627364
is not found, then an empty string is returned for that
73637365
submatch.
@@ -7494,7 +7496,8 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
74947496
< results in [['testing'], [[0, 2, 6]], [99]] >
74957497
:echo matchfuzzypos(['clay', 'lacy'], 'la')
74967498
< results in [['lacy', 'clay'], [[0, 1], [1, 2]], [153, 133]] >
7497-
:echo [{'text': 'hello', 'id' : 10}]->matchfuzzypos('ll', {'key' : 'text'})
7499+
:echo [{'text': 'hello', 'id' : 10}]
7500+
\ ->matchfuzzypos('ll', {'key' : 'text'})
74987501
< results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]]
74997502

75007503
Return type: list<list<any>>
@@ -7538,15 +7541,18 @@ matchstrlist({list}, {pat} [, {dict}])
75387541

75397542
Example: >
75407543
:echo matchstrlist(['tik tok'], '\<\k\+\>')
7541-
[{'idx': 0, 'byteidx': 0, 'text': 'tik'}, {'idx': 0, 'byteidx': 4, 'text': 'tok'}]
7544+
[{'idx': 0, 'byteidx': 0, 'text': 'tik'},
7545+
{'idx': 0, 'byteidx': 4, 'text': 'tok'}]
75427546
:echo matchstrlist(['a', 'b'], '\<\k\+\>')
7543-
[{'idx': 0, 'byteidx': 0, 'text': 'a'}, {'idx': 1, 'byteidx': 0, 'text': 'b'}]
7547+
[{'idx': 0, 'byteidx': 0, 'text': 'a'},
7548+
{'idx': 1, 'byteidx': 0, 'text': 'b'}]
75447549
<
75457550
If "submatches" is present and is v:true, then submatches like
75467551
"\1", "\2", etc. are also returned. Example: >
75477552
:echo matchstrlist(['acd'], '\(a\)\?\(b\)\?\(c\)\?\(.*\)',
75487553
\ #{submatches: v:true})
7549-
[{'idx': 0, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
7554+
[{'idx': 0, 'byteidx': 0, 'text': 'acd',
7555+
'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
75507556
< The "submatches" List always contains 9 items. If a submatch
75517557
is not found, then an empty string is returned for that
75527558
submatch.
@@ -8956,8 +8962,8 @@ remote_send({server}, {string} [, {idvar}]) *remote_send()* *E241*
89568962
Note: Any errors will be reported in the server and may mess
89578963
up the display.
89588964
Examples: >
8959-
:echo remote_send("gvim", ":DropAndReply " .. file, "serverid") ..
8960-
\ remote_read(serverid)
8965+
:echo remote_send("gvim", ":DropAndReply " .. file,
8966+
\ "serverid") .. remote_read(serverid)
89618967
89628968
:autocmd NONE RemoteReply *
89638969
\ echo remote_read(expand("<amatch>"))
@@ -13027,7 +13033,8 @@ python_dynamic Python 2.x interface is dynamically loaded. |has-python|
1302713033
python3 Python 3.x interface available. |has-python|
1302813034
python3_compiled Compiled with Python 3.x interface. |has-python|
1302913035
python3_dynamic Python 3.x interface is dynamically loaded. |has-python|
13030-
python3_stable Python 3.x interface is using Python Stable ABI. |has-python|
13036+
python3_stable Python 3.x interface is using Python Stable ABI.
13037+
|has-python|
1303113038
pythonx Python 2.x and/or 3.x interface available. |python_x|
1303213039
qnx QNX version of Vim.
1303313040
quickfix Compiled with |quickfix| support.

runtime/doc/usr_41.txt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_41.txt* For Vim version 9.1. Last change: 2025 Jul 21
1+
*usr_41.txt* For Vim version 9.1. Last change: 2025 Aug 10
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -30,10 +30,10 @@ Table of contents: |usr_toc.txt|
3030
*41.1* Introduction *vim-script-intro* *script*
3131

3232
Let's start with some nomenclature. A Vim script is any file that Vim can
33-
interpret and execute. This includes files written in Vim's scripting language
34-
like for example .vim files or configuration files like .vimrc and .gvimrc.
35-
These scripts may define functions, commands and settings that Vim uses to
36-
customize and extend its behavior.
33+
interpret and execute. This includes files written in Vim's scripting
34+
language like for example .vim files or configuration files like .vimrc and
35+
.gvimrc. These scripts may define functions, commands and settings that Vim
36+
uses to customize and extend its behavior.
3737

3838
*vim-script-notation*
3939
The correct notation is "Vim script" (or "Vim9 script" when refering to the
@@ -125,8 +125,8 @@ make such a loop, it can be written much more compact: >
125125
echo $"count is {i}"
126126
endfor
127127
128-
We won't explain how `for`, `range()`and `$"string"` work until later. Follow
129-
the links if you are impatient.
128+
We won't explain how `for`, `range()` and `$"string"` work until later.
129+
Follow the links if you are impatient.
130130

131131

132132
TRYING OUT EXAMPLES
@@ -749,7 +749,7 @@ String manipulation: *string-functions*
749749
str2list() get list of numbers from a string
750750
str2nr() convert a string to a Number
751751
str2float() convert a string to a Float
752-
printf() format a string according to % items
752+
printf() format a string according to "%" items
753753
escape() escape characters in a string with a '\'
754754
shellescape() escape a string for use with a shell command
755755
fnameescape() escape a file name for use with a Vim command
@@ -832,9 +832,8 @@ List manipulation: *list-functions*
832832
range() return a List with a sequence of numbers
833833
string() String representation of a List
834834
call() call a function with List as arguments
835-
index() index of a value in a List or Blob
836-
indexof() index in a List or Blob where an expression
837-
evaluates to true
835+
index() index of a value in a List
836+
indexof() index in a List where an expression is true
838837
max() maximum value in a List
839838
min() minimum value in a List
840839
count() count number of times a value appears in a List
@@ -918,6 +917,8 @@ Blob manipulation: *blob-functions*
918917
blob2list() get a list of numbers from a blob
919918
list2blob() get a blob from a list of numbers
920919
reverse() reverse the order of numbers in a blob
920+
index() index of a value in a Blob
921+
indexof() index in a Blob where an expression is true
921922

922923
Other computation: *bitwise-function*
923924
and() bitwise AND
@@ -1456,9 +1457,9 @@ Various: *various-functions*
14561457

14571458
luaeval() evaluate |Lua| expression
14581459
mzeval() evaluate |MzScheme| expression
1459-
perleval() evaluate Perl expression (|+perl|)
1460-
py3eval() evaluate Python expression (|+python3|)
1461-
pyeval() evaluate Python expression (|+python|)
1460+
perleval() evaluate Perl expression
1461+
py3eval() evaluate Python expression
1462+
pyeval() evaluate Python expression
14621463
pyxeval() evaluate |python_x| expression
14631464
rubyeval() evaluate |Ruby| expression
14641465

@@ -1586,7 +1587,7 @@ once for every line in the range, with the cursor in that line. Example: >
15861587
15871588
If you call this function with: >
15881589
1589-
:10,15Number()
1590+
:10,15 call Number()
15901591
15911592
The function will be called six times, starting on line 10 and ending on line
15921593
15.

0 commit comments

Comments
 (0)