diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-01-16 22:02:49 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-01-16 22:02:49 +0000 |
commit | 9cd15160b80729c42b53874d1cf43d4d72c92f02 (patch) | |
tree | 17d8fbb76d7e6cb563369e4504209555e26815dc /runtime/doc/eval.txt | |
parent | 0cf6f545ac227b02bb505adc2afad97a16555ae1 (diff) |
updated for version 7.0040
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index da16256087..5de6a41bd4 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2005 Jan 15 +*eval.txt* For Vim version 7.0aa. Last change: 2005 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -260,7 +260,9 @@ examples: > :call add(list, [1, 2]) " append List as one new item :call extend(list, [1, 2]) " extend the list with two more items :let i = remove(list, 3) " remove item 3 + :unlet list[3] " idem :let l = remove(list, 3, -1) " remove items 3 to last item + :unlet list[3 : ] " idem :call filter(list, 'v:val =~ "x"') " remove items with an 'x' Changing the oder of items in a list: > @@ -416,8 +418,11 @@ use |:let| this way: > :let dict[4] = "four" :let dict['one'] = item -Removing an entry from a Dictionary is done with |remove()|: > - :let i = remove(dict, 'aaa') " remove item with key 'aaa' +Removing an entry from a Dictionary is done with |remove()| or |:unlet|. +Three ways to remove the entry with key "aaa" from dict: > + :let i = remove(dict, 'aaa') + :unlet dict.aaa + :unlet dict['aaa'] Merging a Dictionary with another is done with |extend()|: > :call extend(adict, bdict) " extend adict with entries from bdict @@ -4313,6 +4318,12 @@ This would call the function "my_func_whizz(parameter)". variable names can be given, they are all removed. With [!] no error message is given for non-existing variables. + One or more items from a List can be removed: > + :unlet list[3] " remove fourth item + :unlet list[3:] " remove fourth item to last +< One item from a Dictionary can be removed at a time: > + :unlet dict['two'] + :unlet dict.two :if {expr1} *:if* *:endif* *:en* *E171* *E579* *E580* :en[dif] Execute the commands until the next matching ":else" |