1
- *builtin.txt* For Vim version 9.1. Last change: 2025 Sep 08
1
+ *builtin.txt* For Vim version 9.1. Last change: 2025 Sep 18
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -575,7 +575,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val})
575
575
settagstack({nr} , {dict} [, {action} ])
576
576
Number modify tag stack using {dict}
577
577
setwinvar({nr} , {varname} , {val} ) none set {varname} in window {nr} to {val}
578
- sha256({string } ) String SHA256 checksum of {string}
578
+ sha256({expr } ) String SHA256 checksum of String or Blob
579
579
shellescape({string} [, {special} ])
580
580
String escape {string} for use as shell
581
581
command argument
@@ -1913,10 +1913,11 @@ col({expr} [, {winid}]) *col()*
1913
1913
1914
1914
1915
1915
complete({startcol} , {matches} ) *complete()* *E785*
1916
- Set the matches for Insert mode completion.
1917
- Can only be used in Insert mode. You need to use a mapping
1918
- with CTRL-R = (see | i_CTRL-R | ). It does not work after CTRL-O
1919
- or with an expression mapping.
1916
+ Set the matches for Insert mode completion. Can only be
1917
+ used in Insert mode. Typically invoked from a mapping with
1918
+ CTRL-R = (see | i_CTRL-R | ), but may also be called from a
1919
+ | <Cmd> | or | <ScriptCmd> | mapping. It does not work after
1920
+ CTRL-O or with an expression mapping.
1920
1921
{startcol} is the byte offset in the line where the completed
1921
1922
text start. The text up to the cursor is the original text
1922
1923
that will be replaced by the matches. Use col('.') for an
@@ -1930,15 +1931,31 @@ complete({startcol}, {matches}) *complete()* *E785*
1930
1931
The match can be selected with CTRL-N and CTRL-P as usual with
1931
1932
Insert mode completion. The popup menu will appear if
1932
1933
specified, see | ins-completion-menu | .
1933
- Example: >
1934
- inoremap <F5> <C-R>=ListMonths()<CR>
1935
1934
1936
- func ListMonths()
1937
- call complete(col('.'), ['January', 'February', 'March',
1938
- \ 'April', 'May', 'June', 'July', 'August', 'September',
1939
- \ 'October', 'November', 'December'])
1940
- return ''
1941
- endfunc
1935
+ Example (using legacy Vim script): >
1936
+
1937
+ inoremap <F5> <C-R>=ListMonths()<CR>
1938
+
1939
+ func ListMonths()
1940
+ call complete(col('.'), ['January', 'February', 'March',
1941
+ \ 'April', 'May', 'June', 'July', 'August',
1942
+ \ 'September', \ 'October', 'November', 'December'])
1943
+ return ''
1944
+ endfunc
1945
+ <
1946
+ Example (using Vim9 script): >
1947
+
1948
+ vim9script
1949
+ def ListMonths(): string
1950
+ const months = [ 'January', 'February', 'March', 'April',
1951
+ 'May', 'June', 'July', 'September', 'October',
1952
+ 'November', 'December']
1953
+ complete(col('.'), months)
1954
+ return ''
1955
+ enddef
1956
+
1957
+ inoremap <F5> <ScriptCmd>ListMonths()<CR>
1958
+
1942
1959
< This isn't very useful, but it shows how it works. Note that
1943
1960
an empty string is returned to avoid a zero being inserted.
1944
1961
@@ -10319,12 +10336,14 @@ setwinvar({winnr}, {varname}, {val}) *setwinvar()*
10319
10336
Return type: | Number |
10320
10337
10321
10338
10322
- sha256({string } ) *sha256()*
10339
+ sha256({expr } ) *sha256()*
10323
10340
Returns a String with 64 hex characters, which is the SHA256
10324
- checksum of {string} .
10341
+ checksum of {expr} .
10342
+ {expr} is a String or a Blob.
10325
10343
10326
10344
Can also be used as a | method | : >
10327
10345
GetText()->sha256()
10346
+ GetBlob()->sha256()
10328
10347
<
10329
10348
Return type: | String |
10330
10349
0 commit comments