diff options
Diffstat (limited to '')
-rw-r--r-- | runtime/doc/builtin.txt | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index ec70220..79f3cd7 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 23 +*builtin.txt* For Vim version 9.1. Last change: 2024 Apr 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -220,12 +220,12 @@ getbufvar({buf}, {varname} [, {def}]) any variable {varname} in buffer {buf} getcellwidths() List get character cell width overrides getchangelist([{buf}]) List list of change list items -getchar([expr]) Number or String +getchar([{expr}]) Number or String get one character from the user getcharmod() Number modifiers for the last typed character getcharpos({expr}) List position of cursor, mark, etc. getcharsearch() Dict last character search -getcharstr([expr]) String get one character from the user +getcharstr([{expr}]) String get one character from the user getcmdcompltype() String return the type of the current command-line completion getcmdline() String return the current command-line @@ -398,7 +398,7 @@ menu_info({name} [, {mode}]) Dict get menu item information min({expr}) Number minimum value of items in {expr} mkdir({name} [, {flags} [, {prot}]]) Number create directory {name} -mode([expr]) String current editing mode +mode([{expr}]) String current editing mode mzeval({expr}) any evaluate |MzScheme| expression nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr} [, {utf8}]) String single char with ASCII/UTF-8 value {expr} @@ -699,7 +699,7 @@ test_override({expr}, {val}) none test with Vim internal overrides test_refcount({expr}) Number get the reference count of {expr} test_setmouse({row}, {col}) none set the mouse position for testing test_settime({expr}) none set current time for testing -test_srand_seed([seed]) none set seed for testing srand() +test_srand_seed([{seed}]) none set seed for testing srand() test_unknown() any unknown value for testing test_void() any void value for testing timer_info([{id}]) List information about timers @@ -729,7 +729,7 @@ virtcol({expr} [, {list} [, {winid}]) screen column of cursor or mark virtcol2col({winid}, {lnum}, {col}) Number byte index of a character on screen -visualmode([expr]) String last visual mode used +visualmode([{expr}]) String last visual mode used wildmenumode() Number whether 'wildmenu' mode is active win_execute({id}, {command} [, {silent}]) String execute {command} in window {id} @@ -1771,7 +1771,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) made. It returns the number of the choice. For the first choice this is 1. Note: confirm() is only supported when compiled with dialog - support, see |+dialog_con| and |+dialog_gui|. + support, see |+dialog_con| |+dialog_con_gui| and |+dialog_gui|. {msg} is displayed in a |dialog| with {choices} as the alternatives. When {choices} is missing or empty, "&OK" is @@ -2265,8 +2265,8 @@ empty({expr}) *empty()* - A |Job| is empty when it failed to start. - A |Channel| is empty when it is closed. - A |Blob| is empty when its length is zero. - - An |Object| is empty, when the |empty()| builtin method in - the object (if present) returns true. + - An |Object| is empty, when the empty() method in the object + (if present) returns true. |object-empty()| For a long |List| this is much faster than comparing the length with zero. @@ -2307,7 +2307,8 @@ eval({string}) Evaluate {string} and return the result. Especially useful to turn the result of |string()| back into the original value. This works for Numbers, Floats, Strings, Blobs and composites of them. Also works for |Funcref|s that refer to existing - functions. + functions. In |Vim9| script, it can be used to obtain |enum| + values from their fully qualified names. Can also be used as a |method|: > argv->join()->eval() @@ -3454,16 +3455,16 @@ getchangelist([{buf}]) *getchangelist()* Can also be used as a |method|: > GetBufnr()->getchangelist() -getchar([expr]) *getchar()* +getchar([{expr}]) *getchar()* Get a single character from the user or input stream. - If [expr] is omitted, wait until a character is available. - If [expr] is 0, only get a character when one is available. + If {expr} is omitted, wait until a character is available. + If {expr} is 0, only get a character when one is available. Return zero otherwise. - If [expr] is 1, only check if a character is available, it is + If {expr} is 1, only check if a character is available, it is not consumed. Return zero if no character available. If you prefer always getting a string use |getcharstr()|. - Without [expr] and when [expr] is 0 a whole character or + Without {expr} and when {expr} is 0 a whole character or special key is returned. If it is a single character, the result is a Number. Use |nr2char()| to convert it to a String. Otherwise a String is returned with the encoded character. @@ -3473,11 +3474,11 @@ getchar([expr]) *getchar()* also a String when a modifier (shift, control, alt) was used that is not included in the character. - When [expr] is 0 and Esc is typed, there will be a short delay + When {expr} is 0 and Esc is typed, there will be a short delay while Vim waits to see if this is the start of an escape sequence. - When [expr] is 1 only the first byte is returned. For a + When {expr} is 1 only the first byte is returned. For a one-byte character it is the character itself as a number. Use nr2char() to convert it to a String. @@ -3588,13 +3589,13 @@ getcharsearch() *getcharsearch()* < Also see |setcharsearch()|. -getcharstr([expr]) *getcharstr()* +getcharstr([{expr}]) *getcharstr()* Get a single character from the user or input stream as a string. - If [expr] is omitted, wait until a character is available. - If [expr] is 0 or false, only get a character when one is + If {expr} is omitted, wait until a character is available. + If {expr} is 0 or false, only get a character when one is available. Return an empty string otherwise. - If [expr] is 1 or true, only check if a character is + If {expr} is 1 or true, only check if a character is available, it is not consumed. Return an empty string if no character is available. Otherwise this works like |getchar()|, except that a number @@ -5485,9 +5486,9 @@ len({expr}) The result is a Number, which is the length of the argument. When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Dictionary| the number of entries in the |Dictionary| is returned. - When {expr} is an |Object|, invokes the |len()| method in the - object (if present) to get the length. Otherwise returns - zero. + When {expr} is an |Object|, invokes the len() method in the + object (if present) to get the length (|object-len()|). + Otherwise returns zero. Can also be used as a |method|: > mylist->len() @@ -6647,8 +6648,8 @@ mkdir({name} [, {flags} [, {prot}]]) GetName()->mkdir() < *mode()* -mode([expr]) Return a string that indicates the current mode. - If [expr] is supplied and it evaluates to a non-zero Number or +mode([{expr}]) Return a string that indicates the current mode. + If {expr} is supplied and it evaluates to a non-zero Number or a non-empty String (|non-zero-arg|), then the full mode is returned, otherwise only the first letter is returned. Also see |state()|. @@ -9598,14 +9599,16 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number, Dictionary {key: value, key: value} Class class SomeName Object object of SomeName {lnum: 1, col: 3} + Enum enum EnumName + EnumValue enum name.value {name: str, ordinal: nr} When a |List| or |Dictionary| has a recursive reference it is replaced by "[...]" or "{...}". Using eval() on the result will then fail. - For an object, invokes the |string()| method to get a textual + For an object, invokes the string() method to get a textual representation of the object. If the method is not present, - then the default representation is used. + then the default representation is used. |object-string()| Can also be used as a |method|: > mylist->string() @@ -9977,6 +9980,10 @@ synconcealed({lnum}, {col}) *synconcealed()* synconcealed(lnum, 5) [1, 'X', 2] synconcealed(lnum, 6) [0, '', 0] + Note: Doesn't consider |matchadd()| highlighting items, + since syntax and matching highlighting are two different + mechanisms |syntax-vs-match|. + synstack({lnum}, {col}) *synstack()* Return a |List|, which is the stack of syntax items at the @@ -10461,6 +10468,8 @@ type({expr}) The result is a Number representing the type of {expr}. Class: 12 |v:t_class| Object: 13 |v:t_object| Typealias: 14 |v:t_typealias| + Enum: 15 |v:t_enum| + EnumValue: 16 |v:t_enumvalue| For backward compatibility, this method can be used: > :if type(myvar) == type(0) :if type(myvar) == type("") @@ -11195,6 +11204,7 @@ cscope Compiled with |cscope| support. cursorbind Compiled with |'cursorbind'| (always true) debug Compiled with "DEBUG" defined. dialog_con Compiled with console dialog support. +dialog_con_gui Compiled with console and GUI dialog support. dialog_gui Compiled with GUI dialog support. diff Compiled with |vimdiff| and 'diff' support. digraphs Compiled with support for digraphs. |