comparison runtime/doc/eval.txt @ 68:a97c6902ecd9

updated for version 7.0030
author vimboss
date Tue, 04 Jan 2005 21:38:36 +0000
parents 225cc00b2eda
children 388f285bda1b
comparison
equal deleted inserted replaced
67:6b9e8f951af4 68:a97c6902ecd9
1 *eval.txt* For Vim version 7.0aa. Last change: 2005 Jan 03 1 *eval.txt* For Vim version 7.0aa. Last change: 2005 Jan 04
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
3522 < This is different from searching for an empty string, 3522 < This is different from searching for an empty string,
3523 that would match everywhere. 3523 that would match everywhere.
3524 3524
3525 :let &{option-name} = {expr1} *:let-option* *:let-star* 3525 :let &{option-name} = {expr1} *:let-option* *:let-star*
3526 Set option {option-name} to the result of the 3526 Set option {option-name} to the result of the
3527 expression {expr1}. The value is always converted to 3527 expression {expr1}. A String or Number value is
3528 the type of the option. 3528 always converted to the type of the option.
3529 For an option local to a window or buffer the effect 3529 For an option local to a window or buffer the effect
3530 is just like using the |:set| command: both the local 3530 is just like using the |:set| command: both the local
3531 value and the global value is changed. 3531 value and the global value is changed.
3532 Example: >
3533 :let &path = &path . ',/usr/local/include'
3532 3534
3533 :let &l:{option-name} = {expr1} 3535 :let &l:{option-name} = {expr1}
3534 Like above, but only set the local value of an option 3536 Like above, but only set the local value of an option
3535 (if there is one). Works like |:setlocal|. 3537 (if there is one). Works like |:setlocal|.
3536 3538
3537 :let &g:{option-name} = {expr1} 3539 :let &g:{option-name} = {expr1}
3538 Like above, but only set the global value of an option 3540 Like above, but only set the global value of an option
3539 (if there is one). Works like |:setglobal|. 3541 (if there is one). Works like |:setglobal|.
3540 3542
3543 :let [{name1}, {name2}, ...] = {expr1} *:let-unpack*
3544 {expr1} must evaluate to a List. The first item in
3545 the list is assigned to {name1}, the second item to
3546 {name2}, etc.
3547 The number of names must match the number of items in
3548 the List.
3549 Each name can be one of the items of the ":let"
3550 command as mentioned above.
3551 Example: >
3552 :let [s, item] = GetItem(s)
3553
3554 :let [{name}, ..., ; {lastname}] = {expr1}
3555 Like above, but the List may have more items than
3556 there are names. A list of the remaining items is
3557 assigned to {lastname}. If there are no remaining
3558 items {lastname} is set to an empty list.
3559 Example: >
3560 :let [a, b; rest] = ["aval", "bval", 3, 4]
3561 <
3541 *E106* 3562 *E106*
3542 :let {var-name} .. List the value of variable {var-name}. Several 3563 :let {var-name} .. List the value of variable {var-name}. Several
3543 variable names may be given. 3564 variable names may be given.
3544 3565
3545 :let List the values of all variables. The type of the 3566 :let List the values of all variables. The type of the