-*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 08
+*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 10
VIM REFERENCE MANUAL by Bram Moolenaar
libcallnr({libname}, {funcname}, {argument})
Just like |libcall()|, but used for a function that returns an
int instead of a string.
- {only in Win32 on some Unix versions, when the |+libcall|
+ {only in Win32 and some Unix versions, when the |+libcall|
feature is present}
Examples: >
:echo libcallnr("/usr/lib/libc.so", "getpid", "")
[{'lnum': 3, 'byteidx': 0, 'text': 'a'}]
" Assuming line 4 in buffer 10 contains "tik tok"
:echo matchbufline(10, '\<\k\+\>', 1, 4)
- [{'lnum': 4, 'byteidx': 0, 'text': 'tik'}, {'lnum': 4, 'byteidx': 4, 'text': 'tok'}]
+ [{'lnum': 4, 'byteidx': 0, 'text': 'tik'},
+ {'lnum': 4, 'byteidx': 4, 'text': 'tok'}]
<
If {submatch} is present and is v:true, then submatches like
"\1", "\2", etc. are also returned. Example: >
" Assuming line 2 in buffer 2 contains "acd"
:echo matchbufline(2, '\(a\)\?\(b\)\?\(c\)\?\(.*\)', 2, 2
\ {'submatches': v:true})
- [{'lnum': 2, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
+ [{'lnum': 2, 'byteidx': 0, 'text': 'acd', 'submatches':
+ ['a', '', 'c', 'd', '', '', '', '', '']}]
< The "submatches" List always contains 9 items. If a submatch
is not found, then an empty string is returned for that
submatch.
< results in [['testing'], [[0, 2, 6]], [99]] >
:echo matchfuzzypos(['clay', 'lacy'], 'la')
< results in [['lacy', 'clay'], [[0, 1], [1, 2]], [153, 133]] >
- :echo [{'text': 'hello', 'id' : 10}]->matchfuzzypos('ll', {'key' : 'text'})
+ :echo [{'text': 'hello', 'id' : 10}]
+ \ ->matchfuzzypos('ll', {'key' : 'text'})
< results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]]
Return type: list<list<any>>
Example: >
:echo matchstrlist(['tik tok'], '\<\k\+\>')
- [{'idx': 0, 'byteidx': 0, 'text': 'tik'}, {'idx': 0, 'byteidx': 4, 'text': 'tok'}]
+ [{'idx': 0, 'byteidx': 0, 'text': 'tik'},
+ {'idx': 0, 'byteidx': 4, 'text': 'tok'}]
:echo matchstrlist(['a', 'b'], '\<\k\+\>')
- [{'idx': 0, 'byteidx': 0, 'text': 'a'}, {'idx': 1, 'byteidx': 0, 'text': 'b'}]
+ [{'idx': 0, 'byteidx': 0, 'text': 'a'},
+ {'idx': 1, 'byteidx': 0, 'text': 'b'}]
<
If "submatches" is present and is v:true, then submatches like
"\1", "\2", etc. are also returned. Example: >
:echo matchstrlist(['acd'], '\(a\)\?\(b\)\?\(c\)\?\(.*\)',
\ #{submatches: v:true})
- [{'idx': 0, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
+ [{'idx': 0, 'byteidx': 0, 'text': 'acd',
+ 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]
< The "submatches" List always contains 9 items. If a submatch
is not found, then an empty string is returned for that
submatch.
Note: Any errors will be reported in the server and may mess
up the display.
Examples: >
- :echo remote_send("gvim", ":DropAndReply " .. file, "serverid") ..
- \ remote_read(serverid)
+ :echo remote_send("gvim", ":DropAndReply " .. file,
+ \ "serverid") .. remote_read(serverid)
:autocmd NONE RemoteReply *
\ echo remote_read(expand("<amatch>"))
python3 Python 3.x interface available. |has-python|
python3_compiled Compiled with Python 3.x interface. |has-python|
python3_dynamic Python 3.x interface is dynamically loaded. |has-python|
-python3_stable Python 3.x interface is using Python Stable ABI. |has-python|
+python3_stable Python 3.x interface is using Python Stable ABI.
+ |has-python|
pythonx Python 2.x and/or 3.x interface available. |python_x|
qnx QNX version of Vim.
quickfix Compiled with |quickfix| support.
-*usr_41.txt* For Vim version 9.1. Last change: 2025 Jul 21
+*usr_41.txt* For Vim version 9.1. Last change: 2025 Aug 10
VIM USER MANUAL - by Bram Moolenaar
*41.1* Introduction *vim-script-intro* *script*
Let's start with some nomenclature. A Vim script is any file that Vim can
-interpret and execute. This includes files written in Vim's scripting language
-like for example .vim files or configuration files like .vimrc and .gvimrc.
-These scripts may define functions, commands and settings that Vim uses to
-customize and extend its behavior.
+interpret and execute. This includes files written in Vim's scripting
+language like for example .vim files or configuration files like .vimrc and
+.gvimrc. These scripts may define functions, commands and settings that Vim
+uses to customize and extend its behavior.
*vim-script-notation*
The correct notation is "Vim script" (or "Vim9 script" when refering to the
echo $"count is {i}"
endfor
-We won't explain how `for`, `range()`and `$"string"` work until later. Follow
-the links if you are impatient.
+We won't explain how `for`, `range()` and `$"string"` work until later.
+Follow the links if you are impatient.
TRYING OUT EXAMPLES
str2list() get list of numbers from a string
str2nr() convert a string to a Number
str2float() convert a string to a Float
- printf() format a string according to % items
+ printf() format a string according to "%" items
escape() escape characters in a string with a '\'
shellescape() escape a string for use with a shell command
fnameescape() escape a file name for use with a Vim command
range() return a List with a sequence of numbers
string() String representation of a List
call() call a function with List as arguments
- index() index of a value in a List or Blob
- indexof() index in a List or Blob where an expression
- evaluates to true
+ index() index of a value in a List
+ indexof() index in a List where an expression is true
max() maximum value in a List
min() minimum value in a List
count() count number of times a value appears in a List
blob2list() get a list of numbers from a blob
list2blob() get a blob from a list of numbers
reverse() reverse the order of numbers in a blob
+ index() index of a value in a Blob
+ indexof() index in a Blob where an expression is true
Other computation: *bitwise-function*
and() bitwise AND
luaeval() evaluate |Lua| expression
mzeval() evaluate |MzScheme| expression
- perleval() evaluate Perl expression (|+perl|)
- py3eval() evaluate Python expression (|+python3|)
- pyeval() evaluate Python expression (|+python|)
+ perleval() evaluate Perl expression
+ py3eval() evaluate Python expression
+ pyeval() evaluate Python expression
pyxeval() evaluate |python_x| expression
rubyeval() evaluate |Ruby| expression
If you call this function with: >
- :10,15Number()
+ :10,15 call Number()
The function will be called six times, starting on line 10 and ending on line
15.