Mercurial > vim
comparison runtime/doc/eval.txt @ 10244:876fbdd84e52
commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 1 14:47:05 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 01 Oct 2016 15:00:04 +0200 |
parents | 197795e3530d |
children | d76ccdacb41e |
comparison
equal
deleted
inserted
replaced
10243:fe057ff11e5f | 10244:876fbdd84e52 |
---|---|
1 *eval.txt* For Vim version 8.0. Last change: 2016 Sep 25 | 1 *eval.txt* For Vim version 8.0. Last change: 2016 Sep 28 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
3070 Write {msg} in the channel log file, if it was opened with | 3070 Write {msg} in the channel log file, if it was opened with |
3071 |ch_logfile()|. | 3071 |ch_logfile()|. |
3072 When {handle} is passed the channel number is used for the | 3072 When {handle} is passed the channel number is used for the |
3073 message. | 3073 message. |
3074 {handle} can be Channel or a Job that has a Channel. The | 3074 {handle} can be Channel or a Job that has a Channel. The |
3075 Channel must open. | 3075 Channel must be open for the channel number to be used. |
3076 | 3076 |
3077 ch_logfile({fname} [, {mode}]) *ch_logfile()* | 3077 ch_logfile({fname} [, {mode}]) *ch_logfile()* |
3078 Start logging channel activity to {fname}. | 3078 Start logging channel activity to {fname}. |
3079 When {fname} is an empty string: stop logging. | 3079 When {fname} is an empty string: stop logging. |
3080 | 3080 |
3736 call filter(mylist, function('Odd')) | 3736 call filter(mylist, function('Odd')) |
3737 < It is shorter when using a |lambda|: > | 3737 < It is shorter when using a |lambda|: > |
3738 call filter(myList, {idx, val -> idx * val <= 42}) | 3738 call filter(myList, {idx, val -> idx * val <= 42}) |
3739 < If you do not use "val" you can leave it out: > | 3739 < If you do not use "val" you can leave it out: > |
3740 call filter(myList, {idx -> idx % 2 == 1}) | 3740 call filter(myList, {idx -> idx % 2 == 1}) |
3741 | 3741 < |
3742 The operation is done in-place. If you want a |List| or | 3742 The operation is done in-place. If you want a |List| or |
3743 |Dictionary| to remain unmodified make a copy first: > | 3743 |Dictionary| to remain unmodified make a copy first: > |
3744 :let l = filter(copy(mylist), 'v:val =~ "KEEP"') | 3744 :let l = filter(copy(mylist), 'v:val =~ "KEEP"') |
3745 | 3745 |
3746 < Returns {expr1}, the |List| or |Dictionary| that was filtered. | 3746 < Returns {expr1}, the |List| or |Dictionary| that was filtered. |
4367 :echo getfperm("/etc/passwd") | 4367 :echo getfperm("/etc/passwd") |
4368 :echo getfperm(expand("~/.vimrc")) | 4368 :echo getfperm(expand("~/.vimrc")) |
4369 < This will hopefully (from a security point of view) display | 4369 < This will hopefully (from a security point of view) display |
4370 the string "rw-r--r--" or even "rw-------". | 4370 the string "rw-r--r--" or even "rw-------". |
4371 | 4371 |
4372 For setting permissins use |setfperm()|. | 4372 For setting permissions use |setfperm()|. |
4373 | 4373 |
4374 getftime({fname}) *getftime()* | 4374 getftime({fname}) *getftime()* |
4375 The result is a Number, which is the last modification time of | 4375 The result is a Number, which is the last modification time of |
4376 the given file {fname}. The value is measured as seconds | 4376 the given file {fname}. The value is measured as seconds |
4377 since 1st Jan 1970, and may be passed to strftime(). See also | 4377 since 1st Jan 1970, and may be passed to strftime(). See also |