Mercurial > vim
comparison runtime/doc/eval.txt @ 21093:99a602b27e0e
Runtime file updates
Commit: https://github.com/vim/vim/commit/e46a4405056276b4cbdacee76b11f85c8ea1830b
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 30 20:38:27 2020 +0200
Runtime file updates
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 30 Jun 2020 20:45:06 +0200 |
parents | 59f93c2d2551 |
children | e67123c115d2 |
comparison
equal
deleted
inserted
replaced
21092:f49405905ef6 | 21093:99a602b27e0e |
---|---|
1 *eval.txt* For Vim version 8.2. Last change: 2020 Jun 17 | 1 *eval.txt* For Vim version 8.2. Last change: 2020 Jun 30 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
155 *no-type-checking* | 155 *no-type-checking* |
156 You will not get an error if you try to change the type of a variable. | 156 You will not get an error if you try to change the type of a variable. |
157 | 157 |
158 | 158 |
159 1.2 Function references ~ | 159 1.2 Function references ~ |
160 *Funcref* *E695* *E718* | 160 *Funcref* *E695* *E718* |
161 A Funcref variable is obtained with the |function()| function, the |funcref()| | 161 A Funcref variable is obtained with the |function()| function, the |funcref()| |
162 function or created with the lambda expression |expr-lambda|. It can be used | 162 function or created with the lambda expression |expr-lambda|. It can be used |
163 in an expression in the place of a function name, before the parenthesis | 163 in an expression in the place of a function name, before the parenthesis |
164 around the arguments, to invoke the function it refers to. Example: > | 164 around the arguments, to invoke the function it refers to. Example: > |
165 | 165 |
2509 getimstatus() Number |TRUE| if the IME status is active | 2509 getimstatus() Number |TRUE| if the IME status is active |
2510 getjumplist([{winnr} [, {tabnr}]]) | 2510 getjumplist([{winnr} [, {tabnr}]]) |
2511 List list of jump list items | 2511 List list of jump list items |
2512 getline({lnum}) String line {lnum} of current buffer | 2512 getline({lnum}) String line {lnum} of current buffer |
2513 getline({lnum}, {end}) List lines {lnum} to {end} of current buffer | 2513 getline({lnum}, {end}) List lines {lnum} to {end} of current buffer |
2514 getloclist({nr} [, {what}]) List list of location list items | 2514 getloclist({nr}) List list of location list items |
2515 getloclist({nr}, {what}) Dict get specific location list properties | |
2515 getmarklist([{expr}]) List list of global/local marks | 2516 getmarklist([{expr}]) List list of global/local marks |
2516 getmatches([{win}]) List list of current matches | 2517 getmatches([{win}]) List list of current matches |
2517 getmousepos() Dict last known mouse position | 2518 getmousepos() Dict last known mouse position |
2518 getpid() Number process ID of Vim | 2519 getpid() Number process ID of Vim |
2519 getpos({expr}) List position of cursor, mark, etc. | 2520 getpos({expr}) List position of cursor, mark, etc. |
2520 getqflist([{what}]) List list of quickfix items | 2521 getqflist() List list of quickfix items |
2522 getqflist({what}) Dict get specific quickfix list properties | |
2521 getreg([{regname} [, 1 [, {list}]]]) | 2523 getreg([{regname} [, 1 [, {list}]]]) |
2522 String or List contents of a register | 2524 String or List contents of a register |
2523 getreginfo([{regname}]) Dict information about a register | 2525 getreginfo([{regname}]) Dict information about a register |
2524 getregtype([{regname}]) String type of a register | 2526 getregtype([{regname}]) String type of a register |
2525 gettabinfo([{expr}]) List list of tab pages | 2527 gettabinfo([{expr}]) List list of tab pages |
2754 setcharsearch({dict}) Dict set character search from {dict} | 2756 setcharsearch({dict}) Dict set character search from {dict} |
2755 setcmdpos({pos}) Number set cursor position in command-line | 2757 setcmdpos({pos}) Number set cursor position in command-line |
2756 setenv({name}, {val}) none set environment variable | 2758 setenv({name}, {val}) none set environment variable |
2757 setfperm({fname}, {mode}) Number set {fname} file permissions to {mode} | 2759 setfperm({fname}, {mode}) Number set {fname} file permissions to {mode} |
2758 setline({lnum}, {line}) Number set line {lnum} to {line} | 2760 setline({lnum}, {line}) Number set line {lnum} to {line} |
2759 setloclist({nr}, {list} [, {action} [, {what}]]) | 2761 setloclist({nr}, {list} [, {action}]) |
2760 Number modify location list using {list} | 2762 Number modify location list using {list} |
2763 setloclist({nr}, {list}, {action}, {what}) | |
2764 Number modify specific location list props | |
2761 setmatches({list} [, {win}]) Number restore a list of matches | 2765 setmatches({list} [, {win}]) Number restore a list of matches |
2762 setpos({expr}, {list}) Number set the {expr} position to {list} | 2766 setpos({expr}, {list}) Number set the {expr} position to {list} |
2763 setqflist({list} [, {action} [, {what}]]) | 2767 setqflist({list} [, {action}]) Number modify quickfix list using {list} |
2764 Number modify quickfix list using {list} | 2768 setqflist({list}, {action}, {what}) |
2769 Number modify specific quickfix list props | |
2765 setreg({n}, {v} [, {opt}]) Number set register to value and type | 2770 setreg({n}, {v} [, {opt}]) Number set register to value and type |
2766 settabvar({nr}, {varname}, {val}) none set {varname} in tab page {nr} to {val} | 2771 settabvar({nr}, {varname}, {val}) none set {varname} in tab page {nr} to {val} |
2767 settabwinvar({tabnr}, {winnr}, {varname}, {val}) | 2772 settabwinvar({tabnr}, {winnr}, {varname}, {val}) |
2768 none set {varname} in window {winnr} in tab | 2773 none set {varname} in window {winnr} in tab |
2769 page {tabnr} to {val} | 2774 page {tabnr} to {val} |
3633 Only to be used by the function specified with the | 3638 Only to be used by the function specified with the |
3634 'completefunc' option. | 3639 'completefunc' option. |
3635 | 3640 |
3636 *complete_info()* | 3641 *complete_info()* |
3637 complete_info([{what}]) | 3642 complete_info([{what}]) |
3638 Returns a Dictionary with information about Insert mode | 3643 Returns a |Dictionary| with information about Insert mode |
3639 completion. See |ins-completion|. | 3644 completion. See |ins-completion|. |
3640 The items are: | 3645 The items are: |
3641 mode Current completion mode name string. | 3646 mode Current completion mode name string. |
3642 See |complete_info_mode| for the values. | 3647 See |complete_info_mode| for the values. |
3643 pum_visible |TRUE| if popup menu is visible. | 3648 pum_visible |TRUE| if popup menu is visible. |
4860 Get information about buffers as a List of Dictionaries. | 4865 Get information about buffers as a List of Dictionaries. |
4861 | 4866 |
4862 Without an argument information about all the buffers is | 4867 Without an argument information about all the buffers is |
4863 returned. | 4868 returned. |
4864 | 4869 |
4865 When the argument is a Dictionary only the buffers matching | 4870 When the argument is a |Dictionary| only the buffers matching |
4866 the specified criteria are returned. The following keys can | 4871 the specified criteria are returned. The following keys can |
4867 be specified in {dict}: | 4872 be specified in {dict}: |
4868 buflisted include only listed buffers. | 4873 buflisted include only listed buffers. |
4869 bufloaded include only loaded buffers. | 4874 bufloaded include only loaded buffers. |
4870 bufmodified include only modified buffers. | 4875 bufmodified include only modified buffers. |
5391 ComputeLnum()->getline() | 5396 ComputeLnum()->getline() |
5392 | 5397 |
5393 < To get lines from another buffer see |getbufline()| | 5398 < To get lines from another buffer see |getbufline()| |
5394 | 5399 |
5395 getloclist({nr} [, {what}]) *getloclist()* | 5400 getloclist({nr} [, {what}]) *getloclist()* |
5396 Returns a list with all the entries in the location list for | 5401 Returns a |List| with all the entries in the location list for |
5397 window {nr}. {nr} can be the window number or the |window-ID|. | 5402 window {nr}. {nr} can be the window number or the |window-ID|. |
5398 When {nr} is zero the current window is used. | 5403 When {nr} is zero the current window is used. |
5399 | 5404 |
5400 For a location list window, the displayed location list is | 5405 For a location list window, the displayed location list is |
5401 returned. For an invalid window number {nr}, an empty list is | 5406 returned. For an invalid window number {nr}, an empty list is |
5412 from the location list. This field is | 5417 from the location list. This field is |
5413 applicable only when called from a | 5418 applicable only when called from a |
5414 location list window. See | 5419 location list window. See |
5415 |location-list-file-window| for more | 5420 |location-list-file-window| for more |
5416 details. | 5421 details. |
5422 | |
5423 Returns an empty Dictionary if there is no location list for | |
5424 the window {nr} or the window is not present. | |
5425 | |
5426 Examples (See also |getqflist-examples|): > | |
5427 :echo getloclist(3, {'all': 0}) | |
5428 :echo getloclist(5, {'filewinid': 0}) | |
5429 | |
5417 | 5430 |
5418 getmarklist([{expr}] *getmarklist()* | 5431 getmarklist([{expr}] *getmarklist()* |
5419 Without the {expr} argument returns a |List| with information | 5432 Without the {expr} argument returns a |List| with information |
5420 about all the global marks. |mark| | 5433 about all the global marks. |mark| |
5421 | 5434 |
5457 'priority': 10, 'id': 1}, {'group': 'MyGroup2', | 5470 'priority': 10, 'id': 1}, {'group': 'MyGroup2', |
5458 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > | 5471 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > |
5459 :unlet m | 5472 :unlet m |
5460 < | 5473 < |
5461 getmousepos() *getmousepos()* | 5474 getmousepos() *getmousepos()* |
5462 Returns a Dictionary with the last known position of the | 5475 Returns a |Dictionary| with the last known position of the |
5463 mouse. This can be used in a mapping for a mouse click or in | 5476 mouse. This can be used in a mapping for a mouse click or in |
5464 a filter of a popup window. The items are: | 5477 a filter of a popup window. The items are: |
5465 screenrow screen row | 5478 screenrow screen row |
5466 screencol screen column | 5479 screencol screen column |
5467 winid Window ID of the click | 5480 winid Window ID of the click |
5677 Can also be used as a |method|: > | 5690 Can also be used as a |method|: > |
5678 GetRegname()->getregtype() | 5691 GetRegname()->getregtype() |
5679 | 5692 |
5680 gettabinfo([{arg}]) *gettabinfo()* | 5693 gettabinfo([{arg}]) *gettabinfo()* |
5681 If {arg} is not specified, then information about all the tab | 5694 If {arg} is not specified, then information about all the tab |
5682 pages is returned as a List. Each List item is a Dictionary. | 5695 pages is returned as a |List|. Each List item is a |Dictionary|. |
5683 Otherwise, {arg} specifies the tab page number and information | 5696 Otherwise, {arg} specifies the tab page number and information |
5684 about that one is returned. If the tab page does not exist an | 5697 about that one is returned. If the tab page does not exist an |
5685 empty List is returned. | 5698 empty List is returned. |
5686 | 5699 |
5687 Each List item is a Dictionary with the following entries: | 5700 Each List item is a |Dictionary| with the following entries: |
5688 tabnr tab page number. | 5701 tabnr tab page number. |
5689 variables a reference to the dictionary with | 5702 variables a reference to the dictionary with |
5690 tabpage-local variables | 5703 tabpage-local variables |
5691 windows List of |window-ID|s in the tab page. | 5704 windows List of |window-ID|s in the tab page. |
5692 | 5705 |
5710 Get the value of window-local variable {varname} in window | 5723 Get the value of window-local variable {varname} in window |
5711 {winnr} in tab page {tabnr}. | 5724 {winnr} in tab page {tabnr}. |
5712 When {varname} is empty a dictionary with all window-local | 5725 When {varname} is empty a dictionary with all window-local |
5713 variables is returned. | 5726 variables is returned. |
5714 When {varname} is equal to "&" get the values of all | 5727 When {varname} is equal to "&" get the values of all |
5715 window-local options in a Dictionary. | 5728 window-local options in a |Dictionary|. |
5716 Otherwise, when {varname} starts with "&" get the value of a | 5729 Otherwise, when {varname} starts with "&" get the value of a |
5717 window-local option. | 5730 window-local option. |
5718 Note that {varname} must be the name without "w:". | 5731 Note that {varname} must be the name without "w:". |
5719 Tabs are numbered starting with one. For the current tabpage | 5732 Tabs are numbered starting with one. For the current tabpage |
5720 use |getwinvar()|. | 5733 use |getwinvar()|. |
5765 | 5778 |
5766 Can also be used as a |method|: > | 5779 Can also be used as a |method|: > |
5767 GetWinnr()->gettagstack() | 5780 GetWinnr()->gettagstack() |
5768 | 5781 |
5769 getwininfo([{winid}]) *getwininfo()* | 5782 getwininfo([{winid}]) *getwininfo()* |
5770 Returns information about windows as a List with Dictionaries. | 5783 Returns information about windows as a |List| with Dictionaries. |
5771 | 5784 |
5772 If {winid} is given Information about the window with that ID | 5785 If {winid} is given Information about the window with that ID |
5773 is returned, as a List with one item. If the window does not | 5786 is returned, as a |List| with one item. If the window does not |
5774 exist the result is an empty list. | 5787 exist the result is an empty list. |
5775 | 5788 |
5776 Without {winid} information about all the windows in all the | 5789 Without {winid} information about all the windows in all the |
5777 tab pages is returned. | 5790 tab pages is returned. |
5778 | 5791 |
5779 Each List item is a Dictionary with the following entries: | 5792 Each List item is a |Dictionary| with the following entries: |
5780 botline last displayed buffer line | 5793 botline last displayed buffer line |
5781 bufnr number of buffer in the window | 5794 bufnr number of buffer in the window |
5782 height window height (excluding winbar) | 5795 height window height (excluding winbar) |
5783 loclist 1 if showing a location list | 5796 loclist 1 if showing a location list |
5784 {only with the +quickfix feature} | 5797 {only with the +quickfix feature} |
5802 | 5815 |
5803 Can also be used as a |method|: > | 5816 Can also be used as a |method|: > |
5804 GetWinnr()->getwininfo() | 5817 GetWinnr()->getwininfo() |
5805 | 5818 |
5806 getwinpos([{timeout}]) *getwinpos()* | 5819 getwinpos([{timeout}]) *getwinpos()* |
5807 The result is a List with two numbers, the result of | 5820 The result is a |List| with two numbers, the result of |
5808 |getwinposx()| and |getwinposy()| combined: | 5821 |getwinposx()| and |getwinposy()| combined: |
5809 [x-pos, y-pos] | 5822 [x-pos, y-pos] |
5810 {timeout} can be used to specify how long to wait in msec for | 5823 {timeout} can be used to specify how long to wait in msec for |
5811 a response from the terminal. When omitted 100 msec is used. | 5824 a response from the terminal. When omitted 100 msec is used. |
5812 Use a longer time for a remote terminal. | 5825 Use a longer time for a remote terminal. |
5857 the 'suffixes' and 'wildignore' options apply: Names matching | 5870 the 'suffixes' and 'wildignore' options apply: Names matching |
5858 one of the patterns in 'wildignore' will be skipped and | 5871 one of the patterns in 'wildignore' will be skipped and |
5859 'suffixes' affect the ordering of matches. | 5872 'suffixes' affect the ordering of matches. |
5860 'wildignorecase' always applies. | 5873 'wildignorecase' always applies. |
5861 | 5874 |
5862 When {list} is present and it is |TRUE| the result is a List | 5875 When {list} is present and it is |TRUE| the result is a |List| |
5863 with all matching files. The advantage of using a List is, | 5876 with all matching files. The advantage of using a List is, |
5864 you also get filenames containing newlines correctly. | 5877 you also get filenames containing newlines correctly. |
5865 Otherwise the result is a String and when there are several | 5878 Otherwise the result is a String and when there are several |
5866 matches, they are separated by <NL> characters. | 5879 matches, they are separated by <NL> characters. |
5867 | 5880 |
5920 Unless the optional {nosuf} argument is given and is |TRUE|, | 5933 Unless the optional {nosuf} argument is given and is |TRUE|, |
5921 the 'suffixes' and 'wildignore' options apply: Names matching | 5934 the 'suffixes' and 'wildignore' options apply: Names matching |
5922 one of the patterns in 'wildignore' will be skipped and | 5935 one of the patterns in 'wildignore' will be skipped and |
5923 'suffixes' affect the ordering of matches. | 5936 'suffixes' affect the ordering of matches. |
5924 | 5937 |
5925 When {list} is present and it is |TRUE| the result is a List | 5938 When {list} is present and it is |TRUE| the result is a |List| |
5926 with all matching files. The advantage of using a List is, you | 5939 with all matching files. The advantage of using a List is, you |
5927 also get filenames containing newlines correctly. Otherwise | 5940 also get filenames containing newlines correctly. Otherwise |
5928 the result is a String and when there are several matches, | 5941 the result is a String and when there are several matches, |
5929 they are separated by <NL> characters. Example: > | 5942 they are separated by <NL> characters. Example: > |
5930 :echo globpath(&rtp, "syntax/c.vim", 0, 1) | 5943 :echo globpath(&rtp, "syntax/c.vim", 0, 1) |
7279 GetText()->matchstrpos('word') | 7292 GetText()->matchstrpos('word') |
7280 < | 7293 < |
7281 | 7294 |
7282 *max()* | 7295 *max()* |
7283 max({expr}) Return the maximum value of all items in {expr}. | 7296 max({expr}) Return the maximum value of all items in {expr}. |
7284 {expr} can be a List or a Dictionary. For a Dictionary, | 7297 {expr} can be a |List| or a |Dictionary|. For a Dictionary, |
7285 it returns the maximum of all values in the Dictionary. | 7298 it returns the maximum of all values in the Dictionary. |
7286 If {expr} is neither a List nor a Dictionary, or one of the | 7299 If {expr} is neither a List nor a Dictionary, or one of the |
7287 items in {expr} cannot be used as a Number this results in | 7300 items in {expr} cannot be used as a Number this results in |
7288 an error. An empty |List| or |Dictionary| results in zero. | 7301 an error. An empty |List| or |Dictionary| results in zero. |
7289 | 7302 |
7350 GetMenuName()->menu_info('v') | 7363 GetMenuName()->menu_info('v') |
7351 | 7364 |
7352 | 7365 |
7353 < *min()* | 7366 < *min()* |
7354 min({expr}) Return the minimum value of all items in {expr}. | 7367 min({expr}) Return the minimum value of all items in {expr}. |
7355 {expr} can be a List or a Dictionary. For a Dictionary, | 7368 {expr} can be a |List| or a |Dictionary|. For a Dictionary, |
7356 it returns the minimum of all values in the Dictionary. | 7369 it returns the minimum of all values in the Dictionary. |
7357 If {expr} is neither a List nor a Dictionary, or one of the | 7370 If {expr} is neither a List nor a Dictionary, or one of the |
7358 items in {expr} cannot be used as a Number this results in | 7371 items in {expr} cannot be used as a Number this results in |
7359 an error. An empty |List| or |Dictionary| results in zero. | 7372 an error. An empty |List| or |Dictionary| results in zero. |
7360 | 7373 |
8012 If {expr} results in 0 then this entry will not be | 8025 If {expr} results in 0 then this entry will not be |
8013 added to the list. | 8026 added to the list. |
8014 If {expr} results in 1 then this entry will be added | 8027 If {expr} results in 1 then this entry will be added |
8015 to the list. | 8028 to the list. |
8016 The entries "." and ".." are always excluded. | 8029 The entries "." and ".." are always excluded. |
8017 Each time {expr} is evaluated |v:val| is set to a Dictionary | 8030 Each time {expr} is evaluated |v:val| is set to a |Dictionary| |
8018 of the entry. | 8031 of the entry. |
8019 When {expr} is a function the entry is passed as the argument. | 8032 When {expr} is a function the entry is passed as the argument. |
8020 For example, to get a list of files ending in ".txt": > | 8033 For example, to get a list of files ending in ".txt": > |
8021 readdirex(dirname, {e -> e.name =~ '.txt$'}) | 8034 readdirex(dirname, {e -> e.name =~ '.txt$'}) |
8022 < | 8035 < |
8261 | 8274 |
8262 remove({list}, {idx} [, {end}]) *remove()* | 8275 remove({list}, {idx} [, {end}]) *remove()* |
8263 Without {end}: Remove the item at {idx} from |List| {list} and | 8276 Without {end}: Remove the item at {idx} from |List| {list} and |
8264 return the item. | 8277 return the item. |
8265 With {end}: Remove items from {idx} to {end} (inclusive) and | 8278 With {end}: Remove items from {idx} to {end} (inclusive) and |
8266 return a List with these items. When {idx} points to the same | 8279 return a |List| with these items. When {idx} points to the same |
8267 item as {end} a list with one item is returned. When {end} | 8280 item as {end} a list with one item is returned. When {end} |
8268 points to an item before {idx} this is an error. | 8281 points to an item before {idx} this is an error. |
8269 See |list-index| for possible values of {idx} and {end}. | 8282 See |list-index| for possible values of {idx} and {end}. |
8270 Example: > | 8283 Example: > |
8271 :echo "last item: " . remove(mylist, -1) | 8284 :echo "last item: " . remove(mylist, -1) |
8398 | 8411 |
8399 Can also be used as a |method|: > | 8412 Can also be used as a |method|: > |
8400 GetRow()->screenchar(col) | 8413 GetRow()->screenchar(col) |
8401 | 8414 |
8402 screenchars({row}, {col}) *screenchars()* | 8415 screenchars({row}, {col}) *screenchars()* |
8403 The result is a List of Numbers. The first number is the same | 8416 The result is a |List| of Numbers. The first number is the same |
8404 as what |screenchar()| returns. Further numbers are | 8417 as what |screenchar()| returns. Further numbers are |
8405 composing characters on top of the base character. | 8418 composing characters on top of the base character. |
8406 This is mainly to be used for testing. | 8419 This is mainly to be used for testing. |
8407 Returns an empty List when row or col is out of range. | 8420 Returns an empty List when row or col is out of range. |
8408 | 8421 |
8563 searchcount([{options}]) *searchcount()* | 8576 searchcount([{options}]) *searchcount()* |
8564 Get or update the last search count, like what is displayed | 8577 Get or update the last search count, like what is displayed |
8565 without the "S" flag in 'shortmess'. This works even if | 8578 without the "S" flag in 'shortmess'. This works even if |
8566 'shortmess' does contain the "S" flag. | 8579 'shortmess' does contain the "S" flag. |
8567 | 8580 |
8568 This returns a Dictionary. The dictionary is empty if the | 8581 This returns a |Dictionary|. The dictionary is empty if the |
8569 previous pattern was not set and "pattern" was not specified. | 8582 previous pattern was not set and "pattern" was not specified. |
8570 | 8583 |
8571 key type meaning ~ | 8584 key type meaning ~ |
8572 current |Number| current position of match; | 8585 current |Number| current position of match; |
8573 0 if the cursor position is | 8586 0 if the cursor position is |
8645 | 8658 |
8646 " To restore old search count by old pattern, | 8659 " To restore old search count by old pattern, |
8647 " search again | 8660 " search again |
8648 call searchcount() | 8661 call searchcount() |
8649 < | 8662 < |
8650 {options} must be a Dictionary. It can contain: | 8663 {options} must be a |Dictionary|. It can contain: |
8651 key type meaning ~ | 8664 key type meaning ~ |
8652 recompute |Boolean| if |TRUE|, recompute the count | 8665 recompute |Boolean| if |TRUE|, recompute the count |
8653 like |n| or |N| was executed. | 8666 like |n| or |N| was executed. |
8654 otherwise returns the last | 8667 otherwise returns the last |
8655 computed result (when |n| or | 8668 computed result (when |n| or |
9184 < | 9197 < |
9185 *setreg()* | 9198 *setreg()* |
9186 setreg({regname}, {value} [, {options}]) | 9199 setreg({regname}, {value} [, {options}]) |
9187 Set the register {regname} to {value}. | 9200 Set the register {regname} to {value}. |
9188 If {regname} is "" or "@", the unnamed register '"' is used. | 9201 If {regname} is "" or "@", the unnamed register '"' is used. |
9202 | |
9189 {value} may be any value returned by |getreg()| or | 9203 {value} may be any value returned by |getreg()| or |
9190 |getreginfo()|, including a |List| or |Dict|. | 9204 |getreginfo()|, including a |List| or |Dict|. |
9191 If {options} contains "a" or {regname} is upper case, | 9205 If {options} contains "a" or {regname} is upper case, |
9192 then the value is appended. | 9206 then the value is appended. |
9207 | |
9193 {options} can also contain a register type specification: | 9208 {options} can also contain a register type specification: |
9194 "c" or "v" |characterwise| mode | 9209 "c" or "v" |characterwise| mode |
9195 "l" or "V" |linewise| mode | 9210 "l" or "V" |linewise| mode |
9196 "b" or "<CTRL-V>" |blockwise-visual| mode | 9211 "b" or "<CTRL-V>" |blockwise-visual| mode |
9197 If a number immediately follows "b" or "<CTRL-V>" then this is | 9212 If a number immediately follows "b" or "<CTRL-V>" then this is |
9218 | 9233 |
9219 < This example shows using the functions to save and restore a | 9234 < This example shows using the functions to save and restore a |
9220 register: > | 9235 register: > |
9221 :let var_a = getreginfo() | 9236 :let var_a = getreginfo() |
9222 :call setreg('a', var_a) | 9237 :call setreg('a', var_a) |
9223 < or: | 9238 < or: > |
9224 :let var_a = getreg('a', 1, 1) | 9239 :let var_a = getreg('a', 1, 1) |
9225 :let var_amode = getregtype('a') | 9240 :let var_amode = getregtype('a') |
9226 .... | 9241 .... |
9227 :call setreg('a', var_a, var_amode) | 9242 :call setreg('a', var_a, var_amode) |
9228 < Note: you may not reliably restore register value | 9243 < Note: you may not reliably restore register value |
9695 < | 9710 < |
9696 These characters indicate the state, generally indicating that | 9711 These characters indicate the state, generally indicating that |
9697 something is busy: | 9712 something is busy: |
9698 m halfway a mapping, :normal command, feedkeys() or | 9713 m halfway a mapping, :normal command, feedkeys() or |
9699 stuffed command | 9714 stuffed command |
9700 o operator pending or waiting for a command argument, | 9715 o operator pending, e.g. after |d| |
9701 e.g. after |f| | |
9702 a Insert mode autocomplete active | 9716 a Insert mode autocomplete active |
9703 x executing an autocommand | 9717 x executing an autocommand |
9704 w blocked on waiting, e.g. ch_evalexpr(), ch_read() and | 9718 w blocked on waiting, e.g. ch_evalexpr(), ch_read() and |
9705 ch_readraw() when reading json. | 9719 ch_readraw() when reading json |
9706 S not triggering SafeState or SafeStateAgain | 9720 S not triggering SafeState or SafeStateAgain, e.g. after |
9721 |f| or a count | |
9707 c callback invoked, including timer (repeats for | 9722 c callback invoked, including timer (repeats for |
9708 recursiveness up to "ccc") | 9723 recursiveness up to "ccc") |
9709 s screen has scrolled for messages | 9724 s screen has scrolled for messages |
9710 | 9725 |
9711 str2float({expr}) *str2float()* | 9726 str2float({expr}) *str2float()* |
9882 Funcref function('name') | 9897 Funcref function('name') |
9883 Blob 0z00112233.44556677.8899 | 9898 Blob 0z00112233.44556677.8899 |
9884 List [item, item] | 9899 List [item, item] |
9885 Dictionary {key: value, key: value} | 9900 Dictionary {key: value, key: value} |
9886 | 9901 |
9887 When a List or Dictionary has a recursive reference it is | 9902 When a |List| or |Dictionary| has a recursive reference it is |
9888 replaced by "[...]" or "{...}". Using eval() on the result | 9903 replaced by "[...]" or "{...}". Using eval() on the result |
9889 will then fail. | 9904 will then fail. |
9890 | 9905 |
9891 Can also be used as a |method|: > | 9906 Can also be used as a |method|: > |
9892 mylist->string() | 9907 mylist->string() |
10173 | 10188 |
10174 Can also be used as a |method|: > | 10189 Can also be used as a |method|: > |
10175 :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") | 10190 :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") |
10176 | 10191 |
10177 synconcealed({lnum}, {col}) *synconcealed()* | 10192 synconcealed({lnum}, {col}) *synconcealed()* |
10178 The result is a List with currently three items: | 10193 The result is a |List| with currently three items: |
10179 1. The first item in the list is 0 if the character at the | 10194 1. The first item in the list is 0 if the character at the |
10180 position {lnum} and {col} is not part of a concealable | 10195 position {lnum} and {col} is not part of a concealable |
10181 region, 1 if it is. | 10196 region, 1 if it is. |
10182 2. The second item in the list is a string. If the first item | 10197 2. The second item in the list is a string. If the first item |
10183 is 1, the second item contains the text which will be | 10198 is 1, the second item contains the text which will be |
10218 character in a line and the first column in an empty line are | 10233 character in a line and the first column in an empty line are |
10219 valid positions. | 10234 valid positions. |
10220 | 10235 |
10221 system({expr} [, {input}]) *system()* *E677* | 10236 system({expr} [, {input}]) *system()* *E677* |
10222 Get the output of the shell command {expr} as a string. See | 10237 Get the output of the shell command {expr} as a string. See |
10223 |systemlist()| to get the output as a List. | 10238 |systemlist()| to get the output as a |List|. |
10224 | 10239 |
10225 When {input} is given and is a string this string is written | 10240 When {input} is given and is a string this string is written |
10226 to a file and passed as stdin to the command. The string is | 10241 to a file and passed as stdin to the command. The string is |
10227 written as-is, you need to take care of using the correct line | 10242 written as-is, you need to take care of using the correct line |
10228 separators yourself. | 10243 separators yourself. |
10480 When {id} is given only information about this timer is | 10495 When {id} is given only information about this timer is |
10481 returned. When timer {id} does not exist an empty list is | 10496 returned. When timer {id} does not exist an empty list is |
10482 returned. | 10497 returned. |
10483 When {id} is omitted information about all timers is returned. | 10498 When {id} is omitted information about all timers is returned. |
10484 | 10499 |
10485 For each timer the information is stored in a Dictionary with | 10500 For each timer the information is stored in a |Dictionary| with |
10486 these items: | 10501 these items: |
10487 "id" the timer ID | 10502 "id" the timer ID |
10488 "time" time the timer was started with | 10503 "time" time the timer was started with |
10489 "remaining" time until the timer fires | 10504 "remaining" time until the timer fires |
10490 "repeat" number of times the timer will still fire; | 10505 "repeat" number of times the timer will still fire; |
10714 user. See |undo-blocks|. | 10729 user. See |undo-blocks|. |
10715 "entries" A list of dictionaries with information about | 10730 "entries" A list of dictionaries with information about |
10716 undo blocks. | 10731 undo blocks. |
10717 | 10732 |
10718 The first item in the "entries" list is the oldest undo item. | 10733 The first item in the "entries" list is the oldest undo item. |
10719 Each List item is a Dictionary with these items: | 10734 Each List item is a |Dictionary| with these items: |
10720 "seq" Undo sequence number. Same as what appears in | 10735 "seq" Undo sequence number. Same as what appears in |
10721 |:undolist|. | 10736 |:undolist|. |
10722 "time" Timestamp when the change happened. Use | 10737 "time" Timestamp when the change happened. Use |
10723 |strftime()| to convert to something readable. | 10738 |strftime()| to convert to something readable. |
10724 "newhead" Only appears in the item that is the last one | 10739 "newhead" Only appears in the item that is the last one |
10926 Both {nr} and {target} can be window numbers or |window-ID|s. | 10941 Both {nr} and {target} can be window numbers or |window-ID|s. |
10927 Both must be in the current tab page. | 10942 Both must be in the current tab page. |
10928 | 10943 |
10929 Returns zero for success, non-zero for failure. | 10944 Returns zero for success, non-zero for failure. |
10930 | 10945 |
10931 {options} is a Dictionary with the following optional entries: | 10946 {options} is a |Dictionary| with the following optional entries: |
10932 "vertical" When TRUE, the split is created vertically, | 10947 "vertical" When TRUE, the split is created vertically, |
10933 like with |:vsplit|. | 10948 like with |:vsplit|. |
10934 "rightbelow" When TRUE, the split is made below or to the | 10949 "rightbelow" When TRUE, the split is made below or to the |
10935 right (if vertical). When FALSE, it is done | 10950 right (if vertical). When FALSE, it is done |
10936 above or to the left (if vertical). When not | 10951 above or to the left (if vertical). When not |
12091 *E990* *E991* *E172* *E221* | 12106 *E990* *E991* *E172* *E221* |
12092 :let {var-name} =<< [trim] {endmarker} | 12107 :let {var-name} =<< [trim] {endmarker} |
12093 text... | 12108 text... |
12094 text... | 12109 text... |
12095 {endmarker} | 12110 {endmarker} |
12096 Set internal variable {var-name} to a List containing | 12111 Set internal variable {var-name} to a |List| |
12097 the lines of text bounded by the string {endmarker}. | 12112 containing the lines of text bounded by the string |
12113 {endmarker}. | |
12098 {endmarker} must not contain white space. | 12114 {endmarker} must not contain white space. |
12099 {endmarker} cannot start with a lower case character. | 12115 {endmarker} cannot start with a lower case character. |
12100 The last line should end only with the {endmarker} | 12116 The last line should end only with the {endmarker} |
12101 string without any other character. Watch out for | 12117 string without any other character. Watch out for |
12102 white space after {endmarker}! | 12118 white space after {endmarker}! |