1- *eval.txt* For Vim version 8.2. Last change: 2020 Jun 03
1+ *eval.txt* For Vim version 8.2. Last change: 2020 Jun 07
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2518,8 +2518,9 @@ getpid() Number process ID of Vim
25182518getpos({expr}) List position of cursor, mark, etc.
25192519getqflist([{what}]) List list of quickfix items
25202520getreg([{regname} [, 1 [, {list}]]])
2521- String or List contents of register
2522- getregtype([{regname}]) String type of register
2521+ String or List contents of a register
2522+ getreginfo([{regname}]) Dict information about a register
2523+ getregtype([{regname}]) String type of a register
25232524gettabinfo([{expr}]) List list of tab pages
25242525gettabvar({nr}, {varname} [, {def}])
25252526 any variable {varname} in tab {nr} or {def}
@@ -2728,7 +2729,7 @@ screencol() Number current cursor column
27282729screenpos({winid}, {lnum}, {col}) Dict screen row and col of a text character
27292730screenrow() Number current cursor row
27302731screenstring({row}, {col}) String characters at screen position
2731- search({pattern} [, {flags} [, {stopline} [, {timeout}]]])
2732+ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}] ]]])
27322733 Number search for {pattern}
27332734searchcount([{options}]) Dict get or update search stats
27342735searchdecl({name} [, {global} [, {thisblock}]])
@@ -2737,7 +2738,7 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip} [...]]])
27372738 Number search for other end of start/end pair
27382739searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [...]]])
27392740 List search for other end of start/end pair
2740- searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]])
2741+ searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}] ]]])
27412742 List search for {pattern}
27422743server2client({clientid}, {string})
27432744 Number send reply string
@@ -5123,6 +5124,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
51235124 behave :behave suboptions
51245125 color color schemes
51255126 command Ex command (and arguments)
5127+ cmdline |cmdline-completion| result
51265128 compiler compilers
51275129 cscope |:cscope| suboptions
51285130 diff_buffer |:diffget| and |:diffput| completion
@@ -5153,14 +5155,19 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
51535155 user user names
51545156 var user variables
51555157
5156- If {pat} is an empty string, then all the matches are returned.
5157- Otherwise only items matching {pat} are returned. See
5158- |wildcards| for the use of special characters in {pat}.
5158+ If {pat} is an empty string, then all the matches are
5159+ returned. Otherwise only items matching {pat} are returned.
5160+ See |wildcards| for the use of special characters in {pat}.
51595161
51605162 If the optional {filtered} flag is set to 1, then 'wildignore'
51615163 is applied to filter the results. Otherwise all the matches
51625164 are returned. The 'wildignorecase' option always applies.
51635165
5166+ If {type} is "cmdline", then the |cmdline-completion| result is
5167+ returned. For example, to complete the possible values after
5168+ a ":call" command: >
5169+ echo getcompletion('call ', 'cmdline')
5170+ <
51645171 If there are no matches, an empty list is returned. An
51655172 invalid value for {type} produces an error.
51665173
@@ -5608,6 +5615,31 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
56085615 Can also be used as a |method|: >
56095616 GetRegname()->getreg()
56105617
5618+ getreginfo([{regname}]) *getreginfo()*
5619+ Returns detailed information about register {regname} as a
5620+ Dictionary with the following entries:
5621+ regcontents List of lines contained in register
5622+ {regname}, like
5623+ |getreg|({regname}, 1, 1).
5624+ regtype the type of register {regname}, as in
5625+ |getregtype()|.
5626+ isunnamed Boolean flag, v:true if this register
5627+ is currently pointed to by the unnamed
5628+ register.
5629+ points_to for the unnamed register, gives the
5630+ single letter name of the register
5631+ currently pointed to (see |quotequote|).
5632+ For example, after deleting a line
5633+ with `dd`, this field will be "1",
5634+ which is the register that got the
5635+ deleted text.
5636+
5637+ If {regname} is invalid or not set, an empty Dictionary
5638+ will be returned.
5639+ If {regname} is not specified, |v:register| is used.
5640+
5641+ Can also be used as a |method|: >
5642+ GetRegname()->getreginfo()
56115643
56125644getregtype([{regname}]) *getregtype()*
56135645 The result is a String, which is type of register {regname}.
@@ -8376,8 +8408,9 @@ screenstring({row}, {col}) *screenstring()*
83768408
83778409 Can also be used as a |method|: >
83788410 GetRow()->screenstring(col)
8379-
8380- search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
8411+ <
8412+ *search()*
8413+ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
83818414 Search for regexp pattern {pattern}. The search starts at the
83828415 cursor position (you can use |cursor()| to set it).
83838416
@@ -8425,6 +8458,15 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
84258458 giving the argument.
84268459 {only available when compiled with the |+reltime| feature}
84278460
8461+ If the {skip} expression is given it is evaluated with the
8462+ cursor positioned on the start of a match. If it evaluates to
8463+ non-zero this match is skipped. This can be used, for
8464+ example, to skip a match in a comment or a string.
8465+ {skip} can be a string, which is evaluated as an expression, a
8466+ function reference or a lambda.
8467+ When {skip} is omitted or empty, every match is accepted.
8468+ When evaluating {skip} causes an error the search is aborted
8469+ and -1 returned.
84288470 *search()-sub-match*
84298471 With the 'p' flag the returned value is one more than the
84308472 first sub-match in \(\). One if none of them matched but the
@@ -8708,7 +8750,8 @@ searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}
87088750<
87098751 See |match-parens| for a bigger and more useful example.
87108752
8711- searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *searchpos()*
8753+ *searchpos()*
8754+ searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
87128755 Same as |search()|, but returns a |List| with the line and
87138756 column position of the match. The first element of the |List|
87148757 is the line number and the second element is the byte index of
@@ -9091,8 +9134,8 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
90919134setreg({regname}, {value} [, {options}])
90929135 Set the register {regname} to {value}.
90939136 If {regname} is "" or "@", the unnamed register '"' is used.
9094- {value} may be any value returned by |getreg()|, including
9095- a |List|.
9137+ {value} may be any value returned by |getreg()| or
9138+ |getreginfo()|, including a |List| or |Dict |.
90969139 If {options} contains "a" or {regname} is upper case,
90979140 then the value is appended.
90989141 {options} can also contain a register type specification:
@@ -9119,9 +9162,13 @@ setreg({regname}, {value} [, {options}])
91199162 :call setreg(v:register, @*)
91209163 :call setreg('*', @%, 'ac')
91219164 :call setreg('a', "1\n2\n3", 'b5')
9165+ :call setreg('"', { 'points_to': 'a'})
91229166
91239167< This example shows using the functions to save and restore a
91249168 register: >
9169+ :let var_a = getreginfo()
9170+ :call setreg('a', var_a)
9171+ < or:
91259172 :let var_a = getreg('a', 1, 1)
91269173 :let var_amode = getregtype('a')
91279174 ....
0 commit comments