Mercurial > vim
diff runtime/doc/eval.txt @ 270:a20218704019
updated for version 7.0072
author | vimboss |
---|---|
date | Wed, 18 May 2005 22:17:12 +0000 |
parents | f93df7322443 |
children | fe16c18c24a7 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2005 Apr 22 +*eval.txt* For Vim version 7.0aa. Last change: 2005 May 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -194,6 +194,10 @@ is an empty list. If the second index i :echo mylist[2:1] " result: [] :echo mylist[2:0] " error! +NOTE: mylist[s:e] means using the variable "s:e" as index. Watch out for +using a single letter variable before the ":". Insert a space when needed: +mylist[s : e]. + List identity ~ *list-identity* @@ -4596,14 +4600,14 @@ Using a script in the "autoload" directo exactly the right file name. A function that can be autoloaded has a name like this: > - :call filename:funcname() + :call filename#funcname() When such a function is called, and it is not defined yet, Vim will search the "autoload" directories in 'runtimepath' for a script file called "filename.vim". For example "~/.vim/autoload/filename.vim". That file should then define the function like this: > - function filename:funcname() + function filename#funcname() echo "Done!" endfunction @@ -4611,10 +4615,10 @@ The file name and the name used before t exactly, and the defined function must have the name exactly as it will be called. -It is possible to use subdirectories. Every colon in the function name works -like a path separator. Thus when calling a function: > - - :call foo:bar:func() +It is possible to use subdirectories. Every # in the function name works like +a path separator. Thus when calling a function: > + + :call foo#bar#func() Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'. @@ -4623,13 +4627,13 @@ otherwise it looks like a scope, such as This also works when reading a variable that has not been set yet: > - :let l = foo:bar:lvar + :let l = foo#bar#lvar When assigning a value to such a variable nothing special happens. This can be used to pass settings to the autoload script before it's loaded: > - :let foo:bar:toggle = 1 - :call foo:bar:func() + :let foo#bar#toggle = 1 + :call foo#bar#func() Note that when you make a mistake and call a function that is supposed to be defined in an autoload script, but the script doesn't actually define the