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
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -575,7 +575,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val})
575575settagstack({nr} , {dict} [, {action} ])
576576 Number modify tag stack using {dict}
577577setwinvar({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
579579shellescape({string} [, {special} ])
580580 String escape {string} for use as shell
581581 command argument
@@ -1913,10 +1913,11 @@ col({expr} [, {winid}]) *col()*
19131913
19141914
19151915complete({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.
19201921 {startcol} is the byte offset in the line where the completed
19211922 text start. The text up to the cursor is the original text
19221923 that will be replaced by the matches. Use col('.') for an
@@ -1930,15 +1931,31 @@ complete({startcol}, {matches}) *complete()* *E785*
19301931 The match can be selected with CTRL-N and CTRL-P as usual with
19311932 Insert mode completion. The popup menu will appear if
19321933 specified, see | ins-completion-menu | .
1933- Example: >
1934- inoremap <F5> <C-R>=ListMonths()<CR>
19351934
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+
19421959< This isn't very useful, but it shows how it works. Note that
19431960 an empty string is returned to avoid a zero being inserted.
19441961
@@ -10319,12 +10336,14 @@ setwinvar({winnr}, {varname}, {val}) *setwinvar()*
1031910336 Return type: | Number |
1032010337
1032110338
10322- sha256({string } ) *sha256()*
10339+ sha256({expr } ) *sha256()*
1032310340 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.
1032510343
1032610344 Can also be used as a | method | : >
1032710345 GetText()->sha256()
10346+ GetBlob()->sha256()
1032810347<
1032910348 Return type: | String |
1033010349
0 commit comments