summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-01-25 22:12:55 +0000
committerBram Moolenaar <Bram@vim.org>2005-01-25 22:12:55 +0000
commit8f999f1999cc6f4ccaafab36df25b6d6b1d70117 (patch)
treea5f5ed9ea42204f8c229101ced7e3758032871fb /runtime
parentdf3267e4e1872b2964c8882d9231bafff430f956 (diff)
downloadvim-8f999f1999cc6f4ccaafab36df25b6d6b1d70117.zip
updated for version 7.0044
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt76
-rw-r--r--runtime/doc/pattern.txt8
-rw-r--r--runtime/doc/starting.txt4
-rw-r--r--runtime/filetype.vim6
4 files changed, 55 insertions, 39 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 3eeb98fd7..5cb961132 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 20
+*eval.txt* For Vim version 7.0aa. Last change: 2005 Jan 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -992,6 +992,12 @@ specified by what is prepended:
|function-argument| a: Function argument (only inside a function).
|vim-variable| v: Global, predefined by Vim.
+The scope name by itself can be used as a Dictionary. For example, to delete
+all script-local variables: >
+ :for k in keys(s:)
+ : unlet s:[k]
+ :endfor
+<
*buffer-variable* *b:var*
A variable name that is preceded with "b:" is local to the current buffer.
Thus you can have several "b:foo" variables, one for each buffer.
@@ -1507,7 +1513,8 @@ simplify( {filename}) String simplify filename as much as possible
sort( {list} [, {func}]) List sort {list}, using {func} to compare
split( {expr} [, {pat}]) List make List from {pat} separated {expr}
strftime( {format}[, {time}]) String time in specified format
-stridx( {haystack}, {needle}) Number first index of {needle} in {haystack}
+stridx( {haystack}, {needle}[, {start}])
+ Number index of {needle} in {haystack}
string( {expr}) String String representation of {expr} value
strlen( {expr}) Number length of the String {expr}
strpart( {src}, {start}[, {len}])
@@ -3507,12 +3514,14 @@ strftime({format} [, {time}]) *strftime()*
< Not available on all systems. To check use: >
:if exists("*strftime")
-stridx({haystack}, {needle}) *stridx()*
- The result is a Number, which gives the index in {haystack} of
- the first occurrence of the String {needle} in the String
- {haystack}. The search is done case-sensitive. For advanced
- searches use |match()|.
- If the {needle} does not occur in {haystack} it returns -1.
+stridx({haystack}, {needle} [, {start}]) *stridx()*
+ The result is a Number, which gives the byte index in
+ {haystack} of the first occurrence of the String {needle}.
+ If {start} is specified, the String {needle} is searched from
+ the byte index {start} in the String {haystack}.
+ The search is done case-sensitive.
+ For pattern searches use |match()|.
+ -1 is returned if the {needle} does not occur in {haystack}.
See also |strridx()|. Examples: >
:echo stridx("An Example", "Example") 3
:echo stridx("Starting point", "Start") 0
@@ -3558,10 +3567,10 @@ strpart({src}, {start}[, {len}]) *strpart()*
<
strridx({haystack}, {needle}) *strridx()*
The result is a Number, which gives the index in {haystack} of
- the last occurrence of the String {needle} in the String
- {haystack}. The search is done case-sensitive. For advanced
- searches use |match()|.
- If the {needle} does not occur in {haystack} it returns -1.
+ the last occurrence of the String {needle}.
+ The search is done case-sensitive.
+ For pattern searches use |match()|.
+ -1 is returned if the {needle} does not occur in {haystack}.
If the {needle} is empty the length of {haystack} is returned.
See also |stridx()|. Examples: >
:echo strridx("an angry armadillo", "an") 3
@@ -4069,30 +4078,14 @@ instead of "s:" when the mapping is expanded outside of the script.
result is a |Funcref| to a numbered function. The
function can only be used with a |Funcref| and will be
deleted if there are no more references to it.
- *function-argument* *a:var*
- An argument can be defined by giving its name. In the
- function this can then be used as "a:name" ("a:" for
- argument).
- Up to 20 arguments can be given, separated by commas.
- Finally, an argument "..." can be specified, which
- means that more arguments may be following. In the
- function they can be used as "a:1", "a:2", etc. "a:0"
- is set to the number of extra arguments (which can be
- 0).
- When not using "...", the number of arguments in a
- function call must be equal to the number of named
- arguments. When using "...", the number of arguments
- may be larger.
- It is also possible to define a function without any
- arguments. You must still supply the () then.
- The body of the function follows in the next lines,
- until the matching |:endfunction|. It is allowed to
- define another function inside a function body.
*E127* *E122*
When a function by this name already exists and [!] is
not used an error message is given. When [!] is used,
an existing function is silently replaced. Unless it
is currently being executed, that is an error.
+
+ For the {arguments} see |function-argument|.
+
*a:firstline* *a:lastline*
When the [range] argument is added, the function is
expected to take care of a range itself. The range is
@@ -4139,7 +4132,26 @@ instead of "s:" when the mapping is expanded outside of the script.
nested ":try"s inside the function. The function
returns at the outermost ":endtry".
-
+ *function-argument* *a:var*
+An argument can be defined by giving its name. In the function this can then
+be used as "a:name" ("a:" for argument).
+ *a:0* *a:1* *a:000* *E740*
+Up to 20 arguments can be given, separated by commas. After the named
+arguments an argument "..." can be specified, which means that more arguments
+may optionally be following. In the function the extra arguments can be used
+as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which
+can be 0). "a:000" is set to a List that contains these arguments.
+
+When not using "...", the number of arguments in a function call must be equal
+to the number of named arguments. When using "...", the number of arguments
+may be larger.
+
+It is also possible to define a function without any arguments. You must
+still supply the () then. The body of the function follows in the next lines,
+until the matching |:endfunction|. It is allowed to define another function
+inside a function body.
+
+ *local-variables*
Inside a function variables can be used. These are local variables, which
will disappear when the function returns. Global variables need to be
accessed with "g:".
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 16e889011..21c9f57c0 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt* For Vim version 7.0aa. Last change: 2004 Dec 18
+*pattern.txt* For Vim version 7.0aa. Last change: 2005 Jan 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -217,7 +217,7 @@ To clear the last used search pattern: >
This will not set the pattern to an empty string, because that would match
everywhere. The pattern is really cleared, like when starting Vim.
-The search usual skips matches that don't move the cursor. Whether the next
+The search usually skips matches that don't move the cursor. Whether the next
match is found at the next character or after the skipped match depends on the
'c' flag in 'cpoptions'. See |cpo-c|.
with 'c' flag: "/..." advances 1 to 3 characters
@@ -225,6 +225,10 @@ match is found at the next character or after the skipped match depends on the
The unpredictability with the 'c' flag is caused by starting the search in the
first column, skipping matches until one is found past the cursor position.
+When searching backwards, searching starts at the start of the line, using the
+'c' flag in 'cpoptions' as described above. Then the last match before the
+cursor position is used.
+
In Vi the ":tag" command sets the last search pattern when the tag is searched
for. In Vim this is not done, the previous search pattern is still remembered,
unless the 't' flag is present in 'cpoptions'. The search pattern is always
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 39fbd44cf..49b424afb 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.0aa. Last change: 2005 Jan 20
+*starting.txt* For Vim version 7.0aa. Last change: 2005 Jan 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1193,7 +1193,7 @@ This saves the current Session, and starts off the command to load another.
When [file] is omitted or is a number from 1 to 9, a
name is generated and 'viewdir' prepended. When last
directory name in 'viewdir' does not exist, this
- directory is created. *E738*
+ directory is created. *E739*
An existing file is always overwritten then. Use
|:loadview| to load this view again.
When [file] is the name of a file ('viewdir' is not
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 48d7acc35..40f68b307 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Dec 31
+" Last Change: 2005 Jan 24
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -595,8 +595,8 @@ au BufNewFile,BufRead *.hex,*.h32 setf hex
" Tilde (must be before HTML)
au BufNewFile,BufRead *.t.html setf tilde
-" HTML (.shtml and .stm for server side)
-au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call <SID>FTCheck_html()
+" HTML (.shtml and .stm for server side, .rhtml for Ruby html)
+au BufNewFile,BufRead *.html,*.htm,*.shtml,*.rhtml,*.stm call <SID>FTCheck_html()
" Distinguish between HTML and XHTML
fun! <SID>FTCheck_html()