Mercurial > vim
comparison runtime/doc/eval.txt @ 12427:fc3e2d5614dd v8.0.1093
patch 8.0.1093: various small quickfix issues
commit https://github.com/vim/vim/commit/b4d5fbabc99917a8069ba32a60c2d73d4f60e128
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 11 19:31:28 2017 +0200
patch 8.0.1093: various small quickfix issues
Problem: Various small quickfix issues.
Solution: Remove ":" prefix from title set by a user. Add the qf_id2nr().
function. Add a couple more tests. Update documentation.
(Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 11 Sep 2017 19:45:04 +0200 |
parents | d0cf7f71b95b |
children | 805f7fd40e0d |
comparison
equal
deleted
inserted
replaced
12426:510faba3f8e5 | 12427:fc3e2d5614dd |
---|---|
1 *eval.txt* For Vim version 8.0. Last change: 2017 Aug 13 | 1 *eval.txt* For Vim version 8.0. Last change: 2017 Sep 11 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1447 v:beval_text The text under or after the mouse pointer. Usually a word as | 1447 v:beval_text The text under or after the mouse pointer. Usually a word as |
1448 it is useful for debugging a C program. 'iskeyword' applies, | 1448 it is useful for debugging a C program. 'iskeyword' applies, |
1449 but a dot and "->" before the position is included. When on a | 1449 but a dot and "->" before the position is included. When on a |
1450 ']' the text before it is used, including the matching '[' and | 1450 ']' the text before it is used, including the matching '[' and |
1451 word before it. When on a Visual area within one line the | 1451 word before it. When on a Visual area within one line the |
1452 highlighted text is used. | 1452 highlighted text is used. Also see |<cexpr>|. |
1453 Only valid while evaluating the 'balloonexpr' option. | 1453 Only valid while evaluating the 'balloonexpr' option. |
1454 | 1454 |
1455 *v:beval_winnr* *beval_winnr-variable* | 1455 *v:beval_winnr* *beval_winnr-variable* |
1456 v:beval_winnr The number of the window, over which the mouse pointer is. Only | 1456 v:beval_winnr The number of the window, over which the mouse pointer is. Only |
1457 valid while evaluating the 'balloonexpr' option. The first | 1457 valid while evaluating the 'balloonexpr' option. The first |
3299 {start} can only be used with a |List|. | 3299 {start} can only be used with a |List|. |
3300 | 3300 |
3301 When {ic} is given and it's |TRUE| then case is ignored. | 3301 When {ic} is given and it's |TRUE| then case is ignored. |
3302 | 3302 |
3303 When {comp} is a string then the number of not overlapping | 3303 When {comp} is a string then the number of not overlapping |
3304 occurences of {expr} is returned. | 3304 occurrences of {expr} is returned. |
3305 | 3305 |
3306 | 3306 |
3307 *cscope_connection()* | 3307 *cscope_connection()* |
3308 cscope_connection([{num} , {dbpath} [, {prepend}]]) | 3308 cscope_connection([{num} , {dbpath} [, {prepend}]]) |
3309 Checks for the existence of a |cscope| connection. If no | 3309 Checks for the existence of a |cscope| connection. If no |
3465 Escape the characters in {chars} that occur in {string} with a | 3465 Escape the characters in {chars} that occur in {string} with a |
3466 backslash. Example: > | 3466 backslash. Example: > |
3467 :echo escape('c:\program files\vim', ' \') | 3467 :echo escape('c:\program files\vim', ' \') |
3468 < results in: > | 3468 < results in: > |
3469 c:\\program\ files\\vim | 3469 c:\\program\ files\\vim |
3470 < Also see |shellescape()|. | 3470 < Also see |shellescape()| and |fnameescape()|. |
3471 | 3471 |
3472 *eval()* | 3472 *eval()* |
3473 eval({string}) Evaluate {string} and return the result. Especially useful to | 3473 eval({string}) Evaluate {string} and return the result. Especially useful to |
3474 turn the result of |string()| back into the original value. | 3474 turn the result of |string()| back into the original value. |
3475 This works for Numbers, Floats, Strings and composites of | 3475 This works for Numbers, Floats, Strings and composites of |
3885 decimal point. | 3885 decimal point. |
3886 {expr} must evaluate to a |Float| or a Number. | 3886 {expr} must evaluate to a |Float| or a Number. |
3887 When the value of {expr} is out of range for a |Number| the | 3887 When the value of {expr} is out of range for a |Number| the |
3888 result is truncated to 0x7fffffff or -0x7fffffff (or when | 3888 result is truncated to 0x7fffffff or -0x7fffffff (or when |
3889 64-bit Number support is enabled, 0x7fffffffffffffff or | 3889 64-bit Number support is enabled, 0x7fffffffffffffff or |
3890 -0x7fffffffffffffff. NaN results in -0x80000000 (or when | 3890 -0x7fffffffffffffff). NaN results in -0x80000000 (or when |
3891 64-bit Number support is enabled, -0x8000000000000000). | 3891 64-bit Number support is enabled, -0x8000000000000000). |
3892 Examples: > | 3892 Examples: > |
3893 echo float2nr(3.95) | 3893 echo float2nr(3.95) |
3894 < 3 > | 3894 < 3 > |
3895 echo float2nr(-23.45) | 3895 echo float2nr(-23.45) |
4655 all all of the above quickfix properties | 4655 all all of the above quickfix properties |
4656 Non-string items in {what} are ignored. | 4656 Non-string items in {what} are ignored. |
4657 If "nr" is not present then the current quickfix list is used. | 4657 If "nr" is not present then the current quickfix list is used. |
4658 If both "nr" and a non-zero "id" are specified, then the list | 4658 If both "nr" and a non-zero "id" are specified, then the list |
4659 specified by "id" is used. | 4659 specified by "id" is used. |
4660 To get the number of lists in the quickfix stack, set 'nr' to | 4660 To get the number of lists in the quickfix stack, set "nr" to |
4661 '$' in {what}. The 'nr' value in the returned dictionary | 4661 "$" in {what}. The "nr" value in the returned dictionary |
4662 contains the quickfix stack size. | 4662 contains the quickfix stack size. |
4663 When 'text' is specified, all the other items are ignored. The | 4663 When "lines" is specified, all the other items except "efm" |
4664 returned dictionary contains the entry 'items' with the list | 4664 are ignored. The returned dictionary contains the entry |
4665 of entries. | 4665 "items" with the list of entries. |
4666 In case of error processing {what}, an empty dictionary is | 4666 In case of error processing {what}, an empty dictionary is |
4667 returned. | 4667 returned. |
4668 | 4668 |
4669 The returned dictionary contains the following entries: | 4669 The returned dictionary contains the following entries: |
4670 context context information stored with |setqflist()| | 4670 context context information stored with |setqflist()| |
6965 :call setline(5, ['aaa', 'bbb', 'ccc']) | 6965 :call setline(5, ['aaa', 'bbb', 'ccc']) |
6966 < This is equivalent to: > | 6966 < This is equivalent to: > |
6967 :for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']] | 6967 :for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']] |
6968 : call setline(n, l) | 6968 : call setline(n, l) |
6969 :endfor | 6969 :endfor |
6970 | |
6970 < Note: The '[ and '] marks are not set. | 6971 < Note: The '[ and '] marks are not set. |
6971 | 6972 |
6972 setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()* | 6973 setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()* |
6973 Create or replace or add to the location list for window {nr}. | 6974 Create or replace or add to the location list for window {nr}. |
6974 {nr} can be the window number or the |window-ID|. | 6975 {nr} can be the window number or the |window-ID|. |
7162 :call setreg(v:register, @*) | 7163 :call setreg(v:register, @*) |
7163 :call setreg('*', @%, 'ac') | 7164 :call setreg('*', @%, 'ac') |
7164 :call setreg('a', "1\n2\n3", 'b5') | 7165 :call setreg('a', "1\n2\n3", 'b5') |
7165 | 7166 |
7166 < This example shows using the functions to save and restore a | 7167 < This example shows using the functions to save and restore a |
7167 register (note: you may not reliably restore register value | 7168 register: > |
7168 without using the third argument to |getreg()| as without it | |
7169 newlines are represented as newlines AND Nul bytes are | |
7170 represented as newlines as well, see |NL-used-for-Nul|). > | |
7171 :let var_a = getreg('a', 1, 1) | 7169 :let var_a = getreg('a', 1, 1) |
7172 :let var_amode = getregtype('a') | 7170 :let var_amode = getregtype('a') |
7173 .... | 7171 .... |
7174 :call setreg('a', var_a, var_amode) | 7172 :call setreg('a', var_a, var_amode) |
7175 | 7173 < Note: you may not reliably restore register value |
7176 < You can also change the type of a register by appending | 7174 without using the third argument to |getreg()| as without it |
7175 newlines are represented as newlines AND Nul bytes are | |
7176 represented as newlines as well, see |NL-used-for-Nul|. | |
7177 | |
7178 You can also change the type of a register by appending | |
7177 nothing: > | 7179 nothing: > |
7178 :call setreg('a', '', 'al') | 7180 :call setreg('a', '', 'al') |
7179 | 7181 |
7180 settabvar({tabnr}, {varname}, {val}) *settabvar()* | 7182 settabvar({tabnr}, {varname}, {val}) *settabvar()* |
7181 Set tab-local variable {varname} to {val} in tab page {tabnr}. | 7183 Set tab-local variable {varname} to {val} in tab page {tabnr}. |
8143 {options} are similar to what is used for |job_start()|, see | 8145 {options} are similar to what is used for |job_start()|, see |
8144 |job-options|. However, not all options can be used. These | 8146 |job-options|. However, not all options can be used. These |
8145 are supported: | 8147 are supported: |
8146 all timeout options | 8148 all timeout options |
8147 "stoponexit" | 8149 "stoponexit" |
8148 "out_cb", "err_cb" | 8150 "callback", "out_cb", "err_cb" |
8149 "exit_cb", "close_cb" | 8151 "exit_cb", "close_cb" |
8150 "in_io", "in_top", "in_bot", "in_name", "in_buf" | 8152 "in_io", "in_top", "in_bot", "in_name", "in_buf" |
8151 "out_io", "out_name", "out_buf", "out_modifiable", "out_msg" | 8153 "out_io", "out_name", "out_buf", "out_modifiable", "out_msg" |
8152 "err_io", "err_name", "err_buf", "err_modifiable", "err_msg" | 8154 "err_io", "err_name", "err_buf", "err_modifiable", "err_msg" |
8153 However, at least one of stdin, stdout or stderr must be | 8155 However, at least one of stdin, stdout or stderr must be |
8163 instead of using 'termsize' | 8165 instead of using 'termsize' |
8164 "vertical" split the window vertically | 8166 "vertical" split the window vertically |
8165 "curwin" use the current window, do not split the | 8167 "curwin" use the current window, do not split the |
8166 window; fails if the current buffer | 8168 window; fails if the current buffer |
8167 cannot be |abandon|ed | 8169 cannot be |abandon|ed |
8170 "hidden" do not open a window | |
8168 "term_finish" What to do when the job is finished: | 8171 "term_finish" What to do when the job is finished: |
8169 "close": close any windows | 8172 "close": close any windows |
8170 "open": open window if needed | 8173 "open": open window if needed |
8171 Note that "open" can be interruptive. | 8174 Note that "open" can be interruptive. |
8172 See |term++close| and |term++open|. | 8175 See |term++close| and |term++open|. |
8560 | 8563 |
8561 win_getid([{win} [, {tab}]]) *win_getid()* | 8564 win_getid([{win} [, {tab}]]) *win_getid()* |
8562 Get the |window-ID| for the specified window. | 8565 Get the |window-ID| for the specified window. |
8563 When {win} is missing use the current window. | 8566 When {win} is missing use the current window. |
8564 With {win} this is the window number. The top window has | 8567 With {win} this is the window number. The top window has |
8565 number 1. | 8568 number 1. Use `win_getid(winnr())` for the current window. |
8566 Without {tab} use the current tab, otherwise the tab with | 8569 Without {tab} use the current tab, otherwise the tab with |
8567 number {tab}. The first tab has number one. | 8570 number {tab}. The first tab has number one. |
8568 Return zero if the window cannot be found. | 8571 Return zero if the window cannot be found. |
8569 | 8572 |
8570 win_gotoid({expr}) *win_gotoid()* | 8573 win_gotoid({expr}) *win_gotoid()* |