1- *eval.txt* For Vim version 8.0. Last change: 2017 Jun 13
1+ *eval.txt* For Vim version 8.0. Last change: 2017 Jun 25
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4586,6 +4586,7 @@ getqflist([{what}]) *getqflist()*
45864586 returns only the items listed in {what} as a dictionary. The
45874587 following string items are supported in {what} :
45884588 context get the context stored with | setqflist() |
4589+ items quickfix list entries
45894590 nr get information for this quickfix list; zero
45904591 means the current quickfix list and '$' means
45914592 the last quickfix list
@@ -4602,6 +4603,7 @@ getqflist([{what}]) *getqflist()*
46024603
46034604 The returned dictionary contains the following entries:
46044605 context context information stored with | setqflist() |
4606+ items quickfix list entries
46054607 nr quickfix list number
46064608 title quickfix list title text
46074609 winid quickfix | window-ID | (if opened)
@@ -5466,9 +5468,9 @@ line({expr}) The result is a Number, which is the line number of the file
54665468 This autocommand jumps to the last known position in a file
54675469 just after opening it, if the '" mark is set: >
54685470 :au BufReadPost *
5469- \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
5470- \ | exe "normal! g`\""
5471- \ | endif
5471+ \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
5472+ \ | exe "normal! g`\""
5473+ \ | endif
54725474
54735475 line2byte({lnum} ) *line2byte()*
54745476 Return the byte count from the start of the buffer for line
@@ -5890,15 +5892,15 @@ max({expr}) Return the maximum value of all items in {expr}.
58905892 it returns the maximum of all values in the dictionary.
58915893 If {expr} is neither a list nor a dictionary, or one of the
58925894 items in {expr} cannot be used as a Number this results in
5893- an error. An empty | List | or | Dictionary | results in zero.
5895+ an error. An empty | List | or | Dictionary | results in zero.
58945896
58955897 *min()*
58965898min({expr} ) Return the minimum value of all items in {expr} .
58975899 {expr} can be a list or a dictionary. For a dictionary,
58985900 it returns the minimum of all values in the dictionary.
58995901 If {expr} is neither a list nor a dictionary, or one of the
59005902 items in {expr} cannot be used as a Number this results in
5901- an error. An empty | List | or | Dictionary | results in zero.
5903+ an error. An empty | List | or | Dictionary | results in zero.
59025904
59035905 *mkdir()* *E739*
59045906mkdir({name} [, {path} [, {prot} ]])
@@ -6193,8 +6195,8 @@ printf({fmt}, {expr1} ...) *printf()*
61936195 zero the decimal point is omitted. When the precision
61946196 is not specified 6 is used. A really big number
61956197 (out of range or dividing by zero) results in "inf"
6196- or "-inf" with %f (INF or -INF with %F).
6197- "0.0 / 0.0" results in "nan" with %f (NAN with %F).
6198+ or "-inf" with %f (INF or -INF with %F).
6199+ "0.0 / 0.0" results in "nan" with %f (NAN with %F).
61986200 Example: >
61996201 echo printf("%.2f", 12.115)
62006202< 12.12
@@ -6998,6 +7000,8 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
69987000 argument is ignored. The following items can be specified in
69997001 {what} :
70007002 context any Vim type can be stored as a context
7003+ items list of quickfix entries. Same as the {list}
7004+ argument.
70017005 nr list number in the quickfix stack; zero
70027006 means the current quickfix list and '$' means
70037007 the last quickfix list
@@ -7651,17 +7655,29 @@ synIDtrans({synID}) *synIDtrans()*
76517655 ":highlight link" are followed.
76527656
76537657synconcealed({lnum} , {col} ) *synconcealed()*
7654- The result is a List. The first item in the list is 0 if the
7655- character at the position {lnum} and {col} is not part of a
7656- concealable region, 1 if it is. The second item in the list is
7657- a string. If the first item is 1, the second item contains the
7658- text which will be displayed in place of the concealed text,
7659- depending on the current setting of 'conceallevel' . The third
7660- and final item in the list is a unique number representing the
7661- specific syntax region matched. This allows detection of the
7662- beginning of a new concealable region if there are two
7663- consecutive regions with the same replacement character.
7664- For an example use see $VIMRUNTIME/syntax/2html.vim .
7658+ The result is a List with currently three items:
7659+ 1. The first item in the list is 0 if the character at the
7660+ position {lnum} and {col} is not part of a concealable
7661+ region, 1 if it is.
7662+ 2. The second item in the list is a string. If the first item
7663+ is 1, the second item contains the text which will be
7664+ displayed in place of the concealed text, depending on the
7665+ current setting of 'conceallevel' and 'listchars' .
7666+ 3. The third and final item in the list is a number
7667+ representing the specific syntax region matched in the
7668+ line. When the character is not concealed the value is
7669+ zero. This allows detection of the beginning of a new
7670+ concealable region if there are two consecutive regions
7671+ with the same replacement character. For an example, if
7672+ the text is "123456" and both "23" and "45" are concealed
7673+ and replace by the character "X", then:
7674+ call returns ~
7675+ synconcealed(lnum, 1) [0, '', 0]
7676+ synconcealed(lnum, 2) [1, 'X', 1]
7677+ synconcealed(lnum, 3) [1, 'X', 1]
7678+ synconcealed(lnum, 4) [1, 'X', 2]
7679+ synconcealed(lnum, 5) [1, 'X', 2]
7680+ synconcealed(lnum, 6) [0, '', 0]
76657681
76667682
76677683synstack({lnum} , {col} ) *synstack()*
@@ -7926,8 +7942,19 @@ test_override({name}, {val}) *test_override()*
79267942 name effect when {val} is non-zero ~
79277943 redraw disable the redrawing() function
79287944 char_avail disable the char_avail() function
7945+ starting reset the "starting" variable, see below
79297946 ALL clear all overrides ({val} is not used)
79307947
7948+ "starting" is to be used when a test should behave like
7949+ startup was done. Since the tests are run by sourcing a
7950+ script the "starting" variable is non-zero. This is usually a
7951+ good thing (tests run faster), but sometimes changes behavior
7952+ in a way that the test doesn't work properly.
7953+ When using: >
7954+ call test_override('starting', 1)
7955+ < The value of "starting" is saved. It is restored by: >
7956+ call test_override('starting', 0)
7957+
79317958 test_settime({expr} ) *test_settime()*
79327959 Set the time Vim uses internally. Currently only used for
79337960 timestamps in the history, as they are used in viminfo, and
@@ -8348,8 +8375,8 @@ winwidth({nr}) *winwidth()*
83488375 :if winwidth(0) <= 50
83498376 : exe "normal 50\<C-W>|"
83508377 :endif
8351- < For getting the terminal or screen size, see the 'columns'
8352- option.
8378+ < For getting the terminal or screen size, see the 'columns'
8379+ option.
83538380
83548381
83558382wordcount() *wordcount()*
@@ -8367,11 +8394,11 @@ wordcount() *wordcount()*
83678394 cursor_words Number of words before cursor position
83688395 (not in Visual mode)
83698396 visual_bytes Number of bytes visually selected
8370- (only in Visual mode)
8397+ (only in Visual mode)
83718398 visual_chars Number of chars visually selected
8372- (only in Visual mode)
8399+ (only in Visual mode)
83738400 visual_words Number of chars visually selected
8374- (only in Visual mode)
8401+ (only in Visual mode)
83758402
83768403
83778404 *writefile()*
@@ -8719,6 +8746,9 @@ See |:verbose-cmd| for more information.
87198746 not used an error message is given. When [!] is used,
87208747 an existing function is silently replaced. Unless it
87218748 is currently being executed, that is an error.
8749+ NOTE: Use ! wisely. If used without care it can cause
8750+ an existing function to be replaced unexpectedly,
8751+ which is hard to debug.
87228752
87238753 For the {arguments} see | function-argument | .
87248754
@@ -8768,18 +8798,36 @@ See |:verbose-cmd| for more information.
87688798 implies that the effect of | :nohlsearch | is undone
87698799 when the function returns.
87708800
8771- *:endf* *:endfunction* *E126* *E193*
8772- :endf[unction] The end of a function definition. Must be on a line
8773- by its own, without other commands.
8774-
8801+ *:endf* *:endfunction* *E126* *E193* *W22*
8802+ :endf[unction] [argument]
8803+ The end of a function definition. Best is to put it
8804+ on a line by its own, without [argument] .
8805+
8806+ [argument] can be:
8807+ | command command to execute next
8808+ \n command command to execute next
8809+ " comment always ignored
8810+ anything else ignored, warning given when
8811+ 'verbose' is non-zero
8812+ The support for a following command was added in Vim
8813+ 8.0.0654, before that any argument was silently
8814+ ignored.
8815+
8816+ To be able to define a function inside an `:execute `
8817+ command, use line breaks instead of | :bar | : >
8818+ :exe "func Foo()\necho 'foo'\nendfunc"
8819+ <
87758820 *:delf* *:delfunction* *E130* *E131* *E933*
8776- :delf[unction] {name} Delete function {name} .
8821+ :delf[unction][!] {name}
8822+ Delete function {name} .
87778823 {name} can also be a | Dictionary | entry that is a
87788824 | Funcref | : >
87798825 :delfunc dict.init
87808826< This will remove the "init" entry from "dict". The
87818827 function is deleted if there are no more references to
87828828 it.
8829+ With the ! there is no error if the function does not
8830+ exist.
87838831 *:retu* *:return* *E133*
87848832:retu[rn] [expr] Return from a function. When "[expr]" is given, it is
87858833 evaluated and returned as the result of the function.
0 commit comments