aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt97
1 files changed, 70 insertions, 27 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index c56ab70774..0fc8a30c20 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -77,6 +77,7 @@ changenr() Number current change number
chanclose({id} [, {stream}]) Number Closes a channel or one of its streams
chansend({id}, {data}) Number Writes {data} to channel
char2nr({expr} [, {utf8}]) Number ASCII/UTF-8 value of first char in {expr}
+charclass({string}) Number character class of {string}
charcol({expr}) Number column number of cursor or mark
charidx({string}, {idx} [, {countcc}])
Number char index of byte {idx} in {string}
@@ -119,7 +120,7 @@ dictwatcherdel({dict}, {pattern}, {callback})
did_filetype() Number |TRUE| if FileType autocommand event used
diff_filler({lnum}) Number diff filler lines about {lnum}
diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
-digraph_get({chars}) String get the digraph of {chars}
+digraph_get({chars}) String get the |digraph| of {chars}
digraph_getlist([{listall}]) List get all |digraph|s
digraph_set({chars}, {digraph}) Boolean register |digraph|
digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
@@ -239,8 +240,8 @@ haslocaldir([{winnr} [, {tabnr}]])
the tab executed |:tcd|
hasmapto({what} [, {mode} [, {abbr}]])
Number |TRUE| if mapping to {what} exists
-histadd({history}, {item}) String add an item to a history
-histdel({history} [, {item}]) String remove an item from a history
+histadd({history}, {item}) Number add an item to a history
+histdel({history} [, {item}]) Number remove an item from a history
histget({history} [, {index}]) String get the item {index} from a history
histnr({history}) Number highest index of a history
hlID({name}) Number syntax ID of highlight group {name}
@@ -396,6 +397,7 @@ setbufline({expr}, {lnum}, {text})
Number set line {lnum} to {text} in buffer
{expr}
setbufvar({buf}, {varname}, {val}) set {varname} in buffer {buf} to {val}
+setcellwidths({list}) none set character cell width overrides
setcharpos({expr}, {list}) Number set the {expr} position to {list}
setcharsearch({dict}) Dict set character search from {dict}
setcmdpos({pos}) Number set cursor position in command-line
@@ -586,7 +588,7 @@ acos({expr}) *acos()*
{expr} must evaluate to a |Float| or a |Number| in the range
[-1, 1].
Returns NaN if {expr} is outside the range [-1, 1]. Returns
- 0.0 if {expr} is not a |Float| or a |Number|.
+ 0.0 if {expr} is not a |Float| or a |Number|.
Examples: >
:echo acos(0)
< 1.570796 >
@@ -1063,7 +1065,19 @@ char2nr({string} [, {utf8}]) *char2nr()*
Can also be used as a |method|: >
GetChar()->char2nr()
-<
+
+charclass({string}) *charclass()*
+ Return the character class of the first character in {string}.
+ The character class is one of:
+ 0 blank
+ 1 punctuation
+ 2 word character
+ 3 emoji
+ other specific Unicode class
+ The class is used in patterns and word motions.
+ Returns 0 if {string} is not a |String|.
+
+
*charcol()*
charcol({expr}) Same as |col()| but returns the character index of the column
position given with {expr} instead of the byte position.
@@ -1135,8 +1149,8 @@ cindent({lnum}) *cindent()*
GetLnum()->cindent()
clearmatches([{win}]) *clearmatches()*
- Clears all matches previously defined for the current window
- by |matchadd()| and the |:match| commands.
+ Clears all matches previously defined for the current window
+ by |matchadd()| and the |:match| commands.
If {win} is specified, use the window with this number or
window ID instead of the current window.
@@ -1988,6 +2002,7 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
<afile> autocmd file name
<abuf> autocmd buffer number (as a String!)
<amatch> autocmd matched name
+ <cexpr> C expression under the cursor
<sfile> sourced script file or function name
<slnum> sourced script line number or function
line number
@@ -1995,6 +2010,7 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
a function
<SID> "<SNR>123_" where "123" is the
current script ID |<SID>|
+ <stack> call stack
<cword> word under the cursor
<cWORD> WORD under the cursor
<client> the {clientid} of the last received
@@ -2980,10 +2996,10 @@ getcurpos([{winid}])
current value of the buffer if it is not the current window.
If {winid} is invalid a list with zeroes is returned.
- This can be used to save and restore the cursor position: >
- let save_cursor = getcurpos()
- MoveTheCursorAround
- call setpos('.', save_cursor)
+ This can be used to save and restore the cursor position: >
+ let save_cursor = getcurpos()
+ MoveTheCursorAround
+ call setpos('.', save_cursor)
< Note that this only works within the window. See
|winrestview()| for restoring more state.
@@ -3118,7 +3134,7 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()*
{winnr} can also be a |window-ID|.
With {winnr} and {tabnr} use the window in the specified tab
page. If {winnr} or {tabnr} is invalid, an empty list is
- returned.
+ returned.
The returned list contains two entries: a list with the jump
locations and the last used jump position number in the list.
@@ -3505,7 +3521,7 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
Get the value of window-local variable {varname} in window
{winnr} in tab page {tabnr}.
The {varname} argument is a string. When {varname} is empty a
- dictionary with all window-local variables is returned.
+ dictionary with all window-local variables is returned.
When {varname} is equal to "&" get the values of all
window-local options in a |Dictionary|.
Otherwise, when {varname} starts with "&" get the value of a
@@ -4727,9 +4743,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
listing.
When there is no mapping for {name}, an empty String is
- returned if {dict} is FALSE, otherwise returns an empty Dict.
- When the mapping for {name} is empty, then "<Nop>" is
- returned.
+ returned if {dict} is FALSE, otherwise returns an empty Dict.
+ When the mapping for {name} is empty, then "<Nop>" is
+ returned.
The {name} can have special key names, like in the ":map"
command.
@@ -5903,7 +5919,7 @@ pum_getpos() *pum_getpos()*
size total nr of items
scrollbar |TRUE| if scrollbar is visible
- The values are the same as in |v:event| during |CompleteChanged|.
+ The values are the same as in |v:event| during |CompleteChanged|.
pumvisible() *pumvisible()*
Returns non-zero when the popup menu is visible, zero
@@ -6653,7 +6669,7 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}
When {skip} is omitted or empty, every match is accepted.
When evaluating {skip} causes an error the search is aborted
and -1 returned.
- {skip} can be a string, a lambda, a funcref or a partial.
+ {skip} can be a string, a lambda, a funcref or a partial.
Anything else makes the function fail.
For {stopline} and {timeout} see |search()|.
@@ -6817,6 +6833,33 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()*
third argument: >
GetValue()->setbufvar(buf, varname)
+
+setcellwidths({list}) *setcellwidths()*
+ Specify overrides for cell widths of character ranges. This
+ tells Vim how wide characters are, counted in screen cells.
+ This overrides 'ambiwidth'. Example: >
+ setcellwidths([[0xad, 0xad, 1],
+ \ [0x2194, 0x2199, 2]])
+
+< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
+ The {list} argument is a list of lists with each three
+ numbers. These three numbers are [low, high, width]. "low"
+ and "high" can be the same, in which case this refers to one
+ character. Otherwise it is the range of characters from "low"
+ to "high" (inclusive). "width" is either 1 or 2, indicating
+ the character width in screen cells.
+ An error is given if the argument is invalid, also when a
+ range overlaps with another.
+ Only characters with value 0x100 and higher can be used.
+
+ If the new value causes 'fillchars' or 'listchars' to become
+ invalid it is rejected and an error is given.
+
+ To clear the overrides pass an empty list: >
+ setcellwidths([]);
+< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
+ the effect for known emoji characters.
+
setcharpos({expr}, {list}) *setcharpos()*
Same as |setpos()| but uses the specified column number as the
character index instead of the byte index in the line.
@@ -7665,15 +7708,15 @@ stdpath({what}) *stdpath()* *E6100*
str2float({string} [, {quoted}]) *str2float()*
- Convert String {string} to a Float. This mostly works the
- same as when using a floating point number in an expression,
- see |floating-point-format|. But it's a bit more permissive.
- E.g., "1e40" is accepted, while in an expression you need to
- write "1.0e40". The hexadecimal form "0x123" is also
- accepted, but not others, like binary or octal.
- When {quoted} is present and non-zero then embedded single
- quotes before the dot are ignored, thus "1'000.0" is a
- thousand.
+ Convert String {string} to a Float. This mostly works the
+ same as when using a floating point number in an expression,
+ see |floating-point-format|. But it's a bit more permissive.
+ E.g., "1e40" is accepted, while in an expression you need to
+ write "1.0e40". The hexadecimal form "0x123" is also
+ accepted, but not others, like binary or octal.
+ When {quoted} is present and non-zero then embedded single
+ quotes before the dot are ignored, thus "1'000.0" is a
+ thousand.
Text after the number is silently ignored.
The decimal point is always '.', no matter what the locale is
set to. A comma ends the number: "12,345.67" is converted to