Mercurial > vim
comparison runtime/doc/eval.txt @ 794:f19994020dad
updated for version 7.0231
author | vimboss |
---|---|
date | Tue, 21 Mar 2006 21:29:36 +0000 |
parents | c8680debe1cc |
children | 95dac6af3b3a |
comparison
equal
deleted
inserted
replaced
793:8c0b00d50acf | 794:f19994020dad |
---|---|
1 *eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 19 | 1 *eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 21 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1645 pumvisible() Number whether popup menu is visible | 1645 pumvisible() Number whether popup menu is visible |
1646 range( {expr} [, {max} [, {stride}]]) | 1646 range( {expr} [, {max} [, {stride}]]) |
1647 List items from {expr} to {max} | 1647 List items from {expr} to {max} |
1648 readfile({fname} [, {binary} [, {max}]]) | 1648 readfile({fname} [, {binary} [, {max}]]) |
1649 List get list of lines from file {fname} | 1649 List get list of lines from file {fname} |
1650 reltime( [{start} [, {end}]]) List get time value | |
1651 reltimestr( {time}) String turn time value into a String | |
1650 remote_expr( {server}, {string} [, {idvar}]) | 1652 remote_expr( {server}, {string} [, {idvar}]) |
1651 String send expression | 1653 String send expression |
1652 remote_foreground( {server}) Number bring Vim server to the foreground | 1654 remote_foreground( {server}) Number bring Vim server to the foreground |
1653 remote_peek( {serverid} [, {retvar}]) | 1655 remote_peek( {serverid} [, {retvar}]) |
1654 Number check for reply string | 1656 Number check for reply string |
2460 When an error is encountered while evaluating {string} no | 2462 When an error is encountered while evaluating {string} no |
2461 further items in {expr} are processed. | 2463 further items in {expr} are processed. |
2462 | 2464 |
2463 | 2465 |
2464 finddir({name}[, {path}[, {count}]]) *finddir()* | 2466 finddir({name}[, {path}[, {count}]]) *finddir()* |
2465 Find directory {name} in {path}. | 2467 Find directory {name} in {path}. Returns the path of the |
2468 first found match. When the found directory is below the | |
2469 current directory a relative path is returned. Otherwise a | |
2470 full path is returned. | |
2466 If {path} is omitted or empty then 'path' is used. | 2471 If {path} is omitted or empty then 'path' is used. |
2467 If the optional {count} is given, find {count}'s occurrence of | 2472 If the optional {count} is given, find {count}'s occurrence of |
2468 {name} in {path}. | 2473 {name} in {path} instead of the first one. |
2469 This is quite similar to the ex-command |:find|. | 2474 This is quite similar to the ex-command |:find|. |
2470 When the found directory is below the current directory a | 2475 {only available when compiled with the +file_in_path feature} |
2471 relative path is returned. Otherwise a full path is returned. | 2476 |
2477 findfile({name}[, {path}[, {count}]]) *findfile()* | |
2478 Just like |finddir()|, but find a file instead of a directory. | |
2479 Uses 'suffixesadd'. | |
2472 Example: > | 2480 Example: > |
2473 :echo findfile("tags.vim", ".;") | 2481 :echo findfile("tags.vim", ".;") |
2474 < Searches from the current directory upwards until it finds | 2482 < Searches from the current directory upwards until it finds |
2475 the file "tags.vim". | 2483 the file "tags.vim". |
2476 {only available when compiled with the +file_in_path feature} | |
2477 | |
2478 findfile({name}[, {path}[, {count}]]) *findfile()* | |
2479 Just like |finddir()|, but find a file instead of a directory. | |
2480 | 2484 |
2481 filewritable({file}) *filewritable()* | 2485 filewritable({file}) *filewritable()* |
2482 The result is a Number, which is 1 when a file with the | 2486 The result is a Number, which is 1 when a file with the |
2483 name {file} exists, and can be written. If {file} doesn't | 2487 name {file} exists, and can be written. If {file} doesn't |
2484 exist, or is not writable, the result is 0. If (file) is a | 2488 exist, or is not writable, the result is 0. If (file) is a |
3779 file into a buffer if you need to. | 3783 file into a buffer if you need to. |
3780 When the file can't be opened an error message is given and | 3784 When the file can't be opened an error message is given and |
3781 the result is an empty list. | 3785 the result is an empty list. |
3782 Also see |writefile()|. | 3786 Also see |writefile()|. |
3783 | 3787 |
3788 reltime([{start} [, {end}]]) *reltime()* | |
3789 Return an item that represents a time value. The format of | |
3790 the item depends on the system. It can be passed to | |
3791 |reltimestr()| to convert it to a string. | |
3792 Without an argument it returns the current time. | |
3793 With one argument is returns the time passed since the time | |
3794 specified in the argument. | |
3795 With two arguments it returns the time passed betweein {start} | |
3796 and {end}. | |
3797 The {start} and {end} arguments must be values returned by | |
3798 reltime(). | |
3799 {only available when compiled with the +reltime feature} | |
3800 | |
3801 reltimestr({time}) *reltimestr()* | |
3802 Return a String that represents the time value of {time}. | |
3803 This is the number of seconds, a dot and the number of | |
3804 microseconds. Example: > | |
3805 let start = reltime() | |
3806 call MyFunction() | |
3807 echo reltimestr(reltime(start)) | |
3808 < Note that overhead for the commands will be added to the time. | |
3809 The accuracy depends on the system. | |
3810 Also see |profiling|. | |
3811 {only available when compiled with the +reltime feature} | |
3812 | |
3784 *remote_expr()* *E449* | 3813 *remote_expr()* *E449* |
3785 remote_expr({server}, {string} [, {idvar}]) | 3814 remote_expr({server}, {string} [, {idvar}]) |
3786 Send the {string} to {server}. The string is sent as an | 3815 Send the {string} to {server}. The string is sent as an |
3787 expression and the result is returned after evaluation. | 3816 expression and the result is returned after evaluation. |
3788 The result must be a String or a |List|. A |List| is turned | 3817 The result must be a String or a |List|. A |List| is turned |
4629 The command executed is constructed using several options: | 4658 The command executed is constructed using several options: |
4630 'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote' | 4659 'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote' |
4631 ({tmp} is an automatically generated file name). | 4660 ({tmp} is an automatically generated file name). |
4632 For Unix and OS/2 braces are put around {expr} to allow for | 4661 For Unix and OS/2 braces are put around {expr} to allow for |
4633 concatenated commands. | 4662 concatenated commands. |
4663 | |
4664 The command will be executed in "cooked" mode, so that a | |
4665 CTRL-C will interrupt the command (on Unix at least). | |
4634 | 4666 |
4635 The resulting error code can be found in |v:shell_error|. | 4667 The resulting error code can be found in |v:shell_error|. |
4636 This function will fail in |restricted-mode|. | 4668 This function will fail in |restricted-mode|. |
4637 | 4669 |
4638 Note that any wrong value in the options mentioned above may | 4670 Note that any wrong value in the options mentioned above may |
5433 | 5465 |
5434 Also note that if you have two script files, and one calls a function in the | 5466 Also note that if you have two script files, and one calls a function in the |
5435 other and vise versa, before the used function is defined, it won't work. | 5467 other and vise versa, before the used function is defined, it won't work. |
5436 Avoid using the autoload functionality at the toplevel. | 5468 Avoid using the autoload functionality at the toplevel. |
5437 | 5469 |
5470 Hint: If you distribute a bunch of scripts you can pack them together with the | |
5471 |vimball| utility. Also read the user manual |distribute-script|. | |
5472 | |
5438 ============================================================================== | 5473 ============================================================================== |
5439 6. Curly braces names *curly-braces-names* | 5474 6. Curly braces names *curly-braces-names* |
5440 | 5475 |
5441 Wherever you can use a variable, you can use a "curly braces name" variable. | 5476 Wherever you can use a variable, you can use a "curly braces name" variable. |
5442 This is a regular variable name with one or more expressions wrapped in braces | 5477 This is a regular variable name with one or more expressions wrapped in braces |