1
- *builtin.txt* For Vim version 9.1. Last change: 2025 Feb 01
1
+ *builtin.txt* For Vim version 9.1. Last change: 2025 Feb 06
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -228,12 +228,12 @@ getbufvar({buf}, {varname} [, {def}])
228
228
getcellpixels() List get character cell pixel size
229
229
getcellwidths() List get character cell width overrides
230
230
getchangelist([{buf} ]) List list of change list items
231
- getchar([{expr} ]) Number or String
231
+ getchar([{expr} [, {opts} ]]) Number or String
232
232
get one character from the user
233
233
getcharmod() Number modifiers for the last typed character
234
234
getcharpos({expr} ) List position of cursor, mark, etc.
235
235
getcharsearch() Dict last character search
236
- getcharstr([{expr} ]) String get one character from the user
236
+ getcharstr([{expr} [, {opts} ]]) String get one character from the user
237
237
getcmdcomplpat() String return the completion pattern of the
238
238
current command-line completion
239
239
getcmdcompltype() String return the type of the current
@@ -3918,14 +3918,16 @@ getchangelist([{buf}]) *getchangelist()*
3918
3918
Return type: list<any>
3919
3919
3920
3920
3921
- getchar([{expr} ]) *getchar()*
3921
+ getchar([{expr} [, {opts} ]]) *getchar()*
3922
3922
Get a single character from the user or input stream.
3923
- If {expr} is omitted, wait until a character is available.
3923
+ If {expr} is omitted or is -1, wait until a character is
3924
+ available.
3924
3925
If {expr} is 0, only get a character when one is available.
3925
3926
Return zero otherwise.
3926
3927
If {expr} is 1, only check if a character is available, it is
3927
3928
not consumed. Return zero if no character available.
3928
- If you prefer always getting a string use | getcharstr() | .
3929
+ If you prefer always getting a string use | getcharstr() | , or
3930
+ specify | FALSE | as "number" in {opts} .
3929
3931
3930
3932
Without {expr} and when {expr} is 0 a whole character or
3931
3933
special key is returned. If it is a single character, the
@@ -3935,7 +3937,8 @@ getchar([{expr}]) *getchar()*
3935
3937
starting with 0x80 (decimal: 128). This is the same value as
3936
3938
the String "\<Key> ", e.g., "\<Left> ". The returned value is
3937
3939
also a String when a modifier (shift, control, alt) was used
3938
- that is not included in the character.
3940
+ that is not included in the character. | keytrans() | can also
3941
+ be used to convert a returned String into a readable form.
3939
3942
3940
3943
When {expr} is 0 and Esc is typed, there will be a short delay
3941
3944
while Vim waits to see if this is the start of an escape
@@ -3947,6 +3950,31 @@ getchar([{expr}]) *getchar()*
3947
3950
3948
3951
Use getcharmod() to obtain any additional modifiers.
3949
3952
3953
+ The optional argument {opts} is a Dict and supports the
3954
+ following items:
3955
+
3956
+ cursor A String specifying cursor behavior
3957
+ when waiting for a character.
3958
+ "hide": hide the cursor.
3959
+ "keep": keep current cursor unchanged.
3960
+ "msg": move cursor to message area.
3961
+ (default: "msg")
3962
+
3963
+ number If | TRUE | , return a Number when getting
3964
+ a single character.
3965
+ If | FALSE | , the return value is always
3966
+ converted to a String, and an empty
3967
+ String (instead of 0) is returned when
3968
+ no character is available.
3969
+ (default: | TRUE | )
3970
+
3971
+ simplify If | TRUE | , include modifiers in the
3972
+ character if possible. E.g., return
3973
+ the same value for CTRL-I and <Tab> .
3974
+ If | FALSE | , don't include modifiers in
3975
+ the character.
3976
+ (default: | TRUE | )
3977
+
3950
3978
When the user clicks a mouse button, the mouse event will be
3951
3979
returned. The position can then be found in | v:mouse_col | ,
3952
3980
| v:mouse_lnum | , | v:mouse_winid | and | v:mouse_win | .
@@ -4062,17 +4090,9 @@ getcharsearch() *getcharsearch()*
4062
4090
Return type: dict<any>
4063
4091
4064
4092
4065
- getcharstr([{expr} ]) *getcharstr()*
4066
- Get a single character from the user or input stream as a
4067
- string.
4068
- If {expr} is omitted, wait until a character is available.
4069
- If {expr} is 0 or false, only get a character when one is
4070
- available. Return an empty string otherwise.
4071
- If {expr} is 1 or true, only check if a character is
4072
- available, it is not consumed. Return an empty string
4073
- if no character is available.
4074
- Otherwise this works like | getchar() | , except that a number
4075
- result is converted to a string.
4093
+ getcharstr([{expr} [, {opts} ]]) *getcharstr()*
4094
+ The same as | getchar() | , except that this always returns a
4095
+ String, and "number" isn't allowed in {opts} .
4076
4096
4077
4097
Return type: | String |
4078
4098
@@ -12730,6 +12750,7 @@ gui_win32s idem, and Win32s system being used (Windows 3.1)
12730
12750
haiku Haiku version of Vim.
12731
12751
hangul_input Compiled with Hangul input support. | hangul |
12732
12752
hpux HP-UX version of Vim.
12753
+ hurd GNU/Hurd version of Vim
12733
12754
iconv Can use iconv() for conversion.
12734
12755
insert_expand Compiled with support for CTRL-X expansion commands in
12735
12756
Insert mode. (always true)
0 commit comments